fix(wallets): capture $type in the deposit/withdraw action closure

The action closure referenced $type without importing it via use(), so
every credit/debit attempt in the admin panel threw "Undefined variable
$type" instead of adjusting the wallet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-08 23:58:36 +03:30
parent 936f789ac8
commit d2873ebcc1

View File

@@ -83,7 +83,7 @@ class WalletsTable
->maxLength(500) ->maxLength(500)
->rows(2), ->rows(2),
]) ])
->action(function (Wallet $record, array $data, WalletService $walletService): void { ->action(function (Wallet $record, array $data, WalletService $walletService) use ($type): void {
$amount = (int) $data['amount']; $amount = (int) $data['amount'];
$description = filled($data['description'] ?? null) ? $data['description'] : null; $description = filled($data['description'] ?? null) ? $data['description'] : null;