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

70 lines
2.1 KiB
PHP
Raw Normal View History

<?php
2026-10-05 18:10:18 -04:00
declare(strict_types=1);
namespace Pterodactyl\Models;
2026-10-05 18:10:18 -04:00
use Database\Factories\UserSSHKeyFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Builder;
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;
use Illuminate\Support\Carbon;
/**
* \Pterodactyl\Models\UserSSHKey.
*
* @property int $id
* @property int $user_id
* @property string $name
* @property string $fingerprint
* @property string $public_key
2026-10-05 18:10:18 -04:00
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Carbon|null $deleted_at
2024-10-21 19:18:20 -06:00
* @property User $user
2022-05-22 14:10:01 -04:00
*
2026-10-05 18:10:18 -04:00
* @method static Builder|UserSSHKey newModelQuery()
* @method static Builder|UserSSHKey newQuery()
* @method static \Illuminate\Database\Query\Builder|UserSSHKey onlyTrashed()
2026-10-05 18:10:18 -04:00
* @method static Builder|UserSSHKey query()
* @method static Builder|UserSSHKey whereCreatedAt($value)
* @method static Builder|UserSSHKey whereDeletedAt($value)
* @method static Builder|UserSSHKey whereFingerprint($value)
* @method static Builder|UserSSHKey whereId($value)
* @method static Builder|UserSSHKey whereName($value)
* @method static Builder|UserSSHKey wherePublicKey($value)
* @method static Builder|UserSSHKey whereUpdatedAt($value)
* @method static Builder|UserSSHKey whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|UserSSHKey withTrashed()
* @method static \Illuminate\Database\Query\Builder|UserSSHKey withoutTrashed()
2026-10-05 18:10:18 -04:00
* @method static UserSSHKeyFactory factory(...$parameters)
2022-10-29 19:58:55 -04:00
*
2026-10-05 18:10:18 -04:00
* @mixin \Illuminate\Database\Eloquent\Model
*/
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);
}
}