diff --git a/src/Http/Controllers/Admin/ModuleController.php b/src/Http/Controllers/Admin/ModuleController.php index 28a46dd14..c906e642c 100644 --- a/src/Http/Controllers/Admin/ModuleController.php +++ b/src/Http/Controllers/Admin/ModuleController.php @@ -1841,8 +1841,23 @@ protected function getIndexItems(array $scopes = [], bool $forcePagination = fal $scopes += ['accessible' => true]; } - $appliedFilters = []; + $appliedFilters = $this->getIndexFilters(); + + return $this->transformIndexItems( + $this->repository->get( + with: $this->indexWith, + scopes: $scopes, + orders: $this->orderScope(), + perPage: $this->request->get('offset') ?? $this->perPage ?? 50, + forcePagination: $forcePagination, + appliedFilters: $appliedFilters + ) + ); + } + protected function getIndexFilters(): array + { + $appliedFilters = []; $requestFilters = $this->getRequestFilters(); // Get the applied quick filter.. @@ -1874,16 +1889,7 @@ protected function getIndexItems(array $scopes = [], bool $forcePagination = fal } } - return $this->transformIndexItems( - $this->repository->get( - with: $this->indexWith, - scopes: $scopes, - orders: $this->orderScope(), - perPage: $this->request->get('offset') ?? $this->perPage ?? 50, - forcePagination: $forcePagination, - appliedFilters: $appliedFilters - ) - ); + return $appliedFilters; } protected function transformIndexItems(Collection|LengthAwarePaginator $items): Collection|LengthAwarePaginator diff --git a/src/Http/Controllers/Admin/NestedModuleController.php b/src/Http/Controllers/Admin/NestedModuleController.php index dd807527d..712499d6e 100644 --- a/src/Http/Controllers/Admin/NestedModuleController.php +++ b/src/Http/Controllers/Admin/NestedModuleController.php @@ -48,12 +48,15 @@ protected function getBrowserItems($scopes = []) return $this->getIndexItems($scopes, true); } + $appliedFilters = $this->getIndexFilters(); + return $this->repository->get( $this->indexWith, $scopes, $this->orderScope(), request('offset') ?? $this->perPage ?? 50, - true + true, + $appliedFilters ); } }