Merge pull request #6714 from jitendra-webkul/master

Optimized getting category filterable attributes
This commit is contained in:
Jitendra Singh 2022-09-14 17:16:54 +05:30 committed by GitHub
commit f54172734e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -136,7 +136,7 @@ class AttributeRepository extends Repository
*/
public function getFilterAttributes()
{
return $this->model->where('is_filterable', 1)->with('options')->get();
return $this->model->with(['options', 'options.translations'])->where('is_filterable', 1)->get();
}
/**

View File

@ -90,6 +90,8 @@ class Category extends TranslatableModel implements CategoryContract
'options' => function ($query) {
$query->orderBy('sort_order');
},
'translations',
'options.translations',
]);
}