2022-05-14 17:31:53 -04:00
|
|
|
<?php
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2022-05-14 17:31:53 -04:00
|
|
|
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;
|
2022-05-14 17:31:53 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \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()
|
2022-05-14 17:31:53 -04:00
|
|
|
* @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)
|
2022-05-14 17:31:53 -04:00
|
|
|
* @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
|
2022-05-14 17:31:53 -04:00
|
|
|
*/
|
2026-10-05 18:10:18 -04:00
|
|
|
#[Fillable([
|
|
|
|
|
'name',
|
|
|
|
|
'public_key',
|
|
|
|
|
'fingerprint',
|
|
|
|
|
])]
|
|
|
|
|
#[Table(name: 'user_ssh_keys')]
|
2022-05-14 17:31:53 -04:00
|
|
|
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;
|
2022-05-14 17:31:53 -04:00
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
use SoftDeletes;
|
2022-05-14 17:31:53 -04:00
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
public const string RESOURCE_NAME = 'ssh_key';
|
2022-05-14 17:31:53 -04:00
|
|
|
|
2025-12-20 15:55:13 -08:00
|
|
|
/**
|
2026-10-05 18:10:18 -04:00
|
|
|
* @return BelongsTo<User, $this>
|
2025-12-20 15:55:13 -08:00
|
|
|
*/
|
2022-05-14 17:31:53 -04:00
|
|
|
public function user(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
|
}
|
|
|
|
|
}
|