From 1931acd65d661d695ba56a83e00aa9c52b8d4e9b Mon Sep 17 00:00:00 2001 From: Rastislav Chynoransky Date: Wed, 24 Apr 2024 15:21:21 +0200 Subject: [PATCH] [collection] propagate sorting of items --- app/Http/Controllers/Api/CollectionItemController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Api/CollectionItemController.php b/app/Http/Controllers/Api/CollectionItemController.php index 348439500..1da4747e1 100644 --- a/app/Http/Controllers/Api/CollectionItemController.php +++ b/app/Http/Controllers/Api/CollectionItemController.php @@ -25,6 +25,10 @@ public function index(Collection $collection) $parameters['page'] = request()->integer('page'); } + if (request()->has('sort')) { + $parameters['sort'] = request()->get('sort'); + } + $request = Request::create(route('api.v1.items.index', $parameters)); return app()->handle($request); }