2024-06-02 01:38:30 -04:00

33 lines
659 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserSSHKey extends Model
{
use SoftDeletes;
public const RESOURCE_NAME = 'ssh_key';
protected $table = 'user_ssh_keys';
protected $fillable = [
'name',
'public_key',
'fingerprint',
];
public static array $validationRules = [
'name' => ['required', 'string'],
'fingerprint' => ['required', 'string'],
'public_key' => ['required', 'string'],
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}