misc_pterodactyl-panel/app/Models/UserSSHKey.php

37 lines
762 B
PHP
Raw Normal View History

2021-07-17 21:18:05 +00:00
<?php
namespace Pterodactyl\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
2021-07-17 21:18:05 +00:00
/**
* @property int $id
* @property int $user_id
* @property string $name
* @property string $public_key
* @property \Carbon\CarbonImmutable $created_at
* @property \Pterodactyl\Models\User $user
2021-07-17 21:18:05 +00:00
*/
class UserSSHKey extends Model
{
const UPDATED_AT = null;
2021-07-17 21:18:05 +00:00
protected $table = 'user_ssh_keys';
protected bool $immutableDates = true;
/**
* @var string[]
*/
protected $guarded = ['id', 'created_at'];
public static array $validationRules = [
'name' => 'required|string',
'public_key' => 'required|string',
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
2021-07-17 21:18:05 +00:00
}