Files
compras/app/Models/Concerns/ImmutablePurchaseRecord.php
T
nala 4d42f083ce
tests / ci (push) Canceled after 0s
commit
2026-10-28 12:06:05 +02:00

15 lines
386 B
PHP

<?php
namespace App\Models\Concerns;
use LogicException;
trait ImmutablePurchaseRecord
{
protected static function bootImmutablePurchaseRecord(): void
{
static::updating(fn () => throw new LogicException('O documento emitido não pode ser reescrito.'));
static::deleting(fn () => throw new LogicException('O documento emitido deve ser preservado.'));
}
}