Skip to content

Commit

Permalink
Merge pull request #107 from heseya/feature/MPT-2784
Browse files Browse the repository at this point in the history
Option to get products with all attributes
  • Loading branch information
daVitekPL authored Jan 13, 2025
2 parents f52345a + afa9073 commit 444163e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Repositories/ProductRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function search(ProductSearchDto $dto): LengthAwarePaginator

if (request()->filled('attribute_slug')) {
$query->with([
'productAttributes' => fn (Builder|HasMany $subquery) => $subquery->slug(explode(';', request()->input('attribute_slug'))), // @phpstan-ignore-line
'productAttributes' => fn (Builder|HasMany $subquery) => request()->input('attribute_slug') === '*' ? $subquery : $subquery->slug(explode(';', request()->input('attribute_slug'))), // @phpstan-ignore-line
'productAttributes.attribute',
'productAttributes.attribute.metadata',
'productAttributes.attribute.metadataPrivate',
Expand Down

0 comments on commit 444163e

Please sign in to comment.