diff --git a/src/Eager/RelatedCollection.php b/src/Eager/RelatedCollection.php index 988ff84b5..6cfcdf13a 100644 --- a/src/Eager/RelatedCollection.php +++ b/src/Eager/RelatedCollection.php @@ -164,8 +164,8 @@ public function forRequest(RestifyRequest $request, Repository $repository): sel return $this ->intoAssoc() - ->authorized($request) ->inRequest($request, $repository) + ->authorized($request) ->when($request->isShowRequest(), fn (self $collection) => $collection->forShow($request, $repository)) ->when($request->isIndexRequest(), fn (self $collection) => $collection->forIndex($request, $repository)); }