tr in category
This commit is contained in:
@@ -38,7 +38,17 @@ class FilterController extends Controller
|
||||
private function categories()
|
||||
{
|
||||
if ($this->shouldFilterByCategory()) {
|
||||
return Category::find($this->request->category_id, ['id', 'parent_id'])->children()->get(['id', 'parent_id', 'name']);
|
||||
return Category::query()
|
||||
->find($this->request->category_id, ['id', 'parent_id'])
|
||||
->children()
|
||||
->where('is_visible', true)
|
||||
->ordered()
|
||||
->get(['id', 'parent_id', 'name'])
|
||||
->map(fn ($category) => [
|
||||
'id' => $category->id,
|
||||
'parent_id' => $category->parent_id,
|
||||
'name' => $category->name,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($this->shouldFilterByCollection()) {
|
||||
|
||||
Reference in New Issue
Block a user