From d2873ebcc18219a1e44df2507fe8aeaf5480ee2a Mon Sep 17 00:00:00 2001 From: soheil khaledabadi Date: Tue, 8 Sep 2026 23:58:36 +0330 Subject: [PATCH] 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 --- app/Filament/Resources/Wallets/Tables/WalletsTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Filament/Resources/Wallets/Tables/WalletsTable.php b/app/Filament/Resources/Wallets/Tables/WalletsTable.php index 4d2ae30..15be5e5 100644 --- a/app/Filament/Resources/Wallets/Tables/WalletsTable.php +++ b/app/Filament/Resources/Wallets/Tables/WalletsTable.php @@ -83,7 +83,7 @@ class WalletsTable ->maxLength(500) ->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']; $description = filled($data['description'] ?? null) ? $data['description'] : null;