Files
pterodactyl-panel/app/Models/UserSSHKey.php
T

46 lines
1.0 KiB
PHP
Raw Normal View History

<?php
2026-10-05 18:10:18 -04:00
declare(strict_types=1);
namespace Pterodactyl\Models;
2026-10-11 22:55:07 -04:00
use Carbon\CarbonImmutable;
2026-10-05 18:10:18 -04:00
use Database\Factories\UserSSHKeyFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Table;
2024-10-21 19:18:20 -06:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
2026-10-05 18:10:18 -04:00
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
2026-10-11 22:55:07 -04:00
* Larastan does not read #[Table], so it cannot find this model's columns.
*
* @property string $name
* @property string $fingerprint
* @property string $public_key
2026-10-11 22:55:07 -04:00
* @property CarbonImmutable|null $created_at
*/
2026-10-05 18:10:18 -04:00
#[Fillable([
'name',
'public_key',
'fingerprint',
])]
#[Table(name: 'user_ssh_keys')]
class UserSSHKey extends Model
{
2026-10-05 18:10:18 -04:00
/** @use HasFactory<UserSSHKeyFactory> */
2024-10-21 19:18:20 -06:00
use HasFactory;
2026-10-05 18:10:18 -04:00
use SoftDeletes;
2026-10-05 18:10:18 -04:00
public const string RESOURCE_NAME = 'ssh_key';
/**
2026-10-05 18:10:18 -04:00
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}