52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class TenantArchiveRegistry extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'tenant_archive_registries';
|
|
|
|
protected $fillable = [
|
|
'archive_type',
|
|
'archive_code',
|
|
'amministratore_id',
|
|
'stabile_id',
|
|
'owner_amministratore_id',
|
|
'owner_amministratore_code',
|
|
'database_name',
|
|
'database_strategy',
|
|
'storage_disk',
|
|
'storage_relative_path',
|
|
'status',
|
|
'last_aligned_at',
|
|
'meta',
|
|
];
|
|
|
|
protected $casts = [
|
|
'last_aligned_at' => 'datetime',
|
|
'meta' => 'array',
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
];
|
|
|
|
public function amministratore(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Amministratore::class, 'amministratore_id', 'id');
|
|
}
|
|
|
|
public function stabile(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Stabile::class, 'stabile_id', 'id');
|
|
}
|
|
|
|
public function ownerAmministratore(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Amministratore::class, 'owner_amministratore_id', 'id');
|
|
}
|
|
}
|