Skip to content

Commit dfedad4

Browse files
committed
wip
1 parent 2f061b0 commit dfedad4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Services/Search/RepositorySearchService.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,17 @@ public function prepareRelations(RestifyRequest $request, Builder | Relation $qu
7676
{
7777
$eager = $this->repository::collectRelated()
7878
->forEager($request)
79+
->inRequest($request)
7980
->when($request->isIndexRequest(), fn (RelatedCollection $collection) => $collection->forIndex($request, $this->repository))
8081
->when($request->isShowRequest(), fn (RelatedCollection $collection) => $collection->forShow($request, $this->repository))
8182
->map(fn (EagerField $field) => $field->relation)
82-
->merge(($this->repository)::withs())
8383
->values()
8484
->unique()
8585
->all();
8686

87-
return $query->with($eager);
87+
$query->with($eager);
88+
89+
return $query->with(($this->repository)::withs());
8890
}
8991

9092
public function prepareSearchFields(RestifyRequest $request, $query, $extra = [])

0 commit comments

Comments
 (0)