diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 1e0b6e3605..bcca4e6368 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 255a672e89..8eb3c89172 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)) {