Files
device-management/app/Models/TenantEncryptionKey.php
T
Wian Drs 1e80be180e
tests / ci (push) Has been cancelled
Initial commit device-management
2026-08-25 09:42:00 +07:00

27 lines
641 B
PHP

<?php
namespace App\Models;
use App\Models\Concerns\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class TenantEncryptionKey extends Model
{
use BelongsToTenant;
protected $fillable = ['tenant_id', 'version', 'wrapped_key', 'is_active', 'source', 'created_by', 'retired_at'];
protected $hidden = ['wrapped_key'];
protected static function booted(): void
{
static::creating(fn (self $key) => $key->uuid ??= (string) Str::uuid());
}
protected function casts(): array
{
return ['is_active' => 'boolean', 'retired_at' => 'immutable_datetime'];
}
}