diff --git a/src/Eager/RelatedCollection.php b/src/Eager/RelatedCollection.php index ed032b7a4..440bb5bb1 100644 --- a/src/Eager/RelatedCollection.php +++ b/src/Eager/RelatedCollection.php @@ -180,8 +180,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)) ->when($repository->detectMcpRequest(), fn (self $collection) => $collection->forIndex($request, $repository));