$snapshot */ class AwardCancellation extends Model { use BelongsToTenant; protected $guarded = ['id']; protected $attributes = ['status' => 'pending']; protected function casts(): array { return ['snapshot' => 'array']; } protected static function booted(): void { static::updating(function (AwardCancellation $cancellation) { if ($cancellation->getRawOriginal('status') !== 'pending' || array_diff(array_keys($cancellation->getDirty()), ['status', 'reviewed_by', 'review_reason', 'reviewed_at', 'updated_at']) !== []) { throw new \LogicException('Preservar o pedido de cancelamento e a decisão.'); } }); static::deleting(fn () => throw new \LogicException('Preservar o histórico de cancelamento.')); } }