31 lines
810 B
PHP
31 lines
810 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\BelongsToTenant;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use LogicException;
|
|
|
|
/** @property list<string> $families */
|
|
class PrivateAuditExport extends Model
|
|
{
|
|
use BelongsToTenant;
|
|
|
|
public $timestamps = false;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $hidden = ['path', 'input_hash'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['families' => 'array', 'manifest' => 'array', 'created_at' => 'datetime', 'size' => 'integer'];
|
|
}
|
|
|
|
protected static function booted(): void
|
|
{
|
|
static::updating(fn () => throw new LogicException('Preservar o pacote e o manifesto originais da auditoria.'));
|
|
static::deleting(fn () => throw new LogicException('Preservar o histórico da exportação privada.'));
|
|
}
|
|
}
|