Skip to content

Commit 444163e

Browse files
authored
Merge pull request #107 from heseya/feature/MPT-2784
Option to get products with all attributes
2 parents f52345a + afa9073 commit 444163e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Repositories/ProductRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function search(ProductSearchDto $dto): LengthAwarePaginator
116116

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

0 commit comments

Comments
 (0)