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

32 lines
905 B
PHP

<?php
namespace App\Models;
use App\Enums\DeploymentMode;
use App\Models\Concerns\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Str;
class DeploymentInstallation extends Model
{
use BelongsToTenant;
protected $fillable = ['tenant_id', 'name', 'deployment_type', 'domain', 'instance_key_hash', 'fingerprint_hash', 'status', 'activated_at', 'last_seen_at'];
protected static function booted(): void
{
static::creating(fn (self $installation) => $installation->uuid ??= (string) Str::uuid());
}
protected function casts(): array
{
return ['deployment_type' => DeploymentMode::class, 'activated_at' => 'immutable_datetime', 'last_seen_at' => 'immutable_datetime'];
}
public function licenses(): HasMany
{
return $this->hasMany(License::class);
}
}