From 641cda79afce1b82790d71e0ca6938de262eaaee Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 9 Feb 2023 13:12:26 +1100 Subject: [PATCH] Clean up for bank integration bulk actions --- app/Http/Controllers/BankIntegrationController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/BankIntegrationController.php b/app/Http/Controllers/BankIntegrationController.php index 552aa02fe..a742255e3 100644 --- a/app/Http/Controllers/BankIntegrationController.php +++ b/app/Http/Controllers/BankIntegrationController.php @@ -472,10 +472,12 @@ class BankIntegrationController extends BaseController $ids = request()->input('ids'); - $bank_integrations = BankIntegration::withTrashed()->whereIn('id', $this->transformKeys($ids))->company()->get(); + $bank_integrations = BankIntegration::withTrashed()->whereIn('id', $this->transformKeys($ids)) + ->company() + ->cursor() + ->each(function ($bank_integration, $key) use ($action) { - $bank_integrations->each(function ($bank_integration, $key) use ($action) { - $this->bank_integration_repo->{$action}($bank_integration); + $this->bank_integration_repo->{$action}($bank_integration); }); /* Need to understand which permission are required for the given bulk action ie. view / edit */