2022-05-14 21:31:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \Pterodactyl\Models\UserSSHKey.
|
|
|
|
*
|
|
|
|
* @property int $id
|
|
|
|
* @property int $user_id
|
|
|
|
* @property string $name
|
|
|
|
* @property string $fingerprint
|
|
|
|
* @property string $public_key
|
|
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
|
|
* @property \Illuminate\Support\Carbon|null $deleted_at
|
|
|
|
* @property \Pterodactyl\Models\User $user
|
2022-05-22 18:10:01 +00:00
|
|
|
*
|
2022-05-14 21:31:53 +00:00
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey newModelQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey newQuery()
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|UserSSHKey onlyTrashed()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey query()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey whereCreatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey whereDeletedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey whereFingerprint($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey whereId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey whereName($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey wherePublicKey($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey whereUpdatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|UserSSHKey whereUserId($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|UserSSHKey withTrashed()
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|UserSSHKey withoutTrashed()
|
2022-10-29 22:16:18 +00:00
|
|
|
*
|
2022-05-14 21:31:53 +00:00
|
|
|
* @mixin \Eloquent
|
2022-05-22 18:10:01 +00:00
|
|
|
*
|
2022-05-14 22:08:48 +00:00
|
|
|
* @method static \Database\Factories\UserSSHKeyFactory factory(...$parameters)
|
2022-05-14 21:31:53 +00:00
|
|
|
*/
|
|
|
|
class UserSSHKey extends Model
|
|
|
|
{
|
|
|
|
use SoftDeletes;
|
|
|
|
|
|
|
|
public const RESOURCE_NAME = 'ssh_key';
|
|
|
|
|
|
|
|
protected $table = 'user_ssh_keys';
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
'name',
|
|
|
|
'public_key',
|
|
|
|
'fingerprint',
|
|
|
|
];
|
|
|
|
|
2022-10-14 16:59:20 +00:00
|
|
|
public static array $validationRules = [
|
2022-05-14 21:31:53 +00:00
|
|
|
'name' => ['required', 'string'],
|
|
|
|
'fingerprint' => ['required', 'string'],
|
|
|
|
'public_key' => ['required', 'string'],
|
|
|
|
];
|
|
|
|
|
|
|
|
public function user(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
}
|
|
|
|
}
|