Files
compras/app/Models/AuditLog.php
T
2026-11-02 08:08:05 +02:00

32 lines
747 B
PHP

<?php
namespace App\Models;
use App\Models\Concerns\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use LogicException;
/**
* @property array<string,mixed>|null $before
* @property array<string,mixed> $after
*/
class AuditLog extends Model
{
use BelongsToTenant;
public $timestamps = false;
protected $guarded = ['id'];
protected function casts(): array
{
return ['before' => 'array', 'after' => 'array'];
}
protected static function booted(): void
{
static::updating(fn () => throw new LogicException('O histórico de auditoria não pode ser alterado.'));
static::deleting(fn () => throw new LogicException('O histórico de auditoria não pode ser eliminado.'));
}
}