@@ -0,0 +1,14 @@
|
||||
<?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.'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user