Skip to content

Commit 6b7567e

Browse files
committed
wip
1 parent 41f8437 commit 6b7567e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Repositories/Repository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ public function index(RestifyRequest $request)
591591
: ($request->perPage ?? static::$defaultPerPage)
592592
);
593593

594-
$items = $paginator->getCollection()->map(function ($value) {
594+
$items = $this->indexCollection($request, $paginator->getCollection())->map(function ($value) {
595595
return static::resolveWith($value);
596596
})->filter(function (self $repository) use ($request) {
597597
return $repository->authorizedToShow($request);
@@ -602,7 +602,7 @@ public function index(RestifyRequest $request)
602602
$request, $items->map(fn (self $repository) => $repository->resource), RepositoryCollection::meta($paginator->toArray())
603603
) ?? RepositoryCollection::meta($paginator->toArray()),
604604
'links' => RepositoryCollection::paginationLinks($paginator->toArray()),
605-
'data' => $this->indexCollection($request, $items)->map(fn (self $repository) => $repository->serializeForIndex($request)),
605+
'data' => $items->map(fn (self $repository) => $repository->serializeForIndex($request)),
606606
]);
607607
}
608608

0 commit comments

Comments
 (0)