From 4086203a81194cf0287710bbca6cf88f7c435180 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 13 Jul 2021 19:26:59 +1000 Subject: [PATCH] Minor fixes for product and client bulk actions --- app/Http/Controllers/ClientController.php | 2 +- app/Http/Controllers/ProductController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 1e0b6e360535..bcca4e6368a9 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -510,7 +510,7 @@ class ClientController extends BaseController $action = request()->input('action'); $ids = request()->input('ids'); - $clients = Client::withTrashed()->find($this->transformKeys($ids)); + $clients = Client::withTrashed()->whereIn('id', $this->transformKeys($ids))->cursor(); $clients->each(function ($client, $key) use ($action) { if (auth()->user()->can('edit', $client)) { diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index 255a672e8964..8eb3c89172e9 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -470,7 +470,7 @@ class ProductController extends BaseController $ids = request()->input('ids'); - $products = Product::withTrashed()->find($this->transformKeys($ids)); + $products = Product::withTrashed()->whereIn('id', $this->transformKeys($ids))->cursor(); $products->each(function ($product, $key) use ($action) { if (auth()->user()->can('edit', $product)) {