fix: cash record policy, observer, n+1 query

This commit is contained in:
2026-05-11 18:56:54 +00:00
parent 3bc0fa58ac
commit f89bedb0fd
6 changed files with 27 additions and 29 deletions
+1 -5
View File
@@ -66,10 +66,6 @@ class CashRecordObserver
public function deleting(CashRecord $record): void
{
if ($record->verified_at !== null) {
throw new \Illuminate\Auth\Access\AuthorizationException(
'Transaksi yang sudah diverifikasi tidak dapat dihapus.'
);
}
// Guard ditangani di CashRecordPolicy::delete() — tidak perlu throw di sini
}
}