Skip to content

Commit e1efd91

Browse files
committed
Debug
1 parent e775ffe commit e1efd91

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

app/Http/Controllers/Public/HomeController.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ public function index(Request $request)
4646
$query->where('name', 'like', '%'.$request->search.'%');
4747
}
4848

49-
if ($request->filled('category') && $request->category !== 'all') {
50-
$category = Category::find($request->category);
51-
if ($category) {
52-
$query->where(function ($query) use ($category) {
53-
$query->where('category_id', $category->id)
54-
->orWhereHas('category', function ($query) use ($category) {
55-
$query->where('parent_id', $category->id)
56-
->orWhere('id', $category->parent_id);
57-
});
58-
});
59-
}
60-
}
49+
// if ($request->filled('category') && $request->category !== 'all') {
50+
// $category = Category::find($request->category);
51+
// if ($category) {
52+
// $query->where(function ($query) use ($category) {
53+
// $query->where('category_id', $category->id)
54+
// ->orWhereHas('category', function ($query) use ($category) {
55+
// $query->where('parent_id', $category->id)
56+
// ->orWhere('id', $category->parent_id);
57+
// });
58+
// });
59+
// }
60+
// }
6161

6262
// Apply location filter if preferences exist
6363
if ($locationPreferences && isset($locationPreferences['coordinates'], $locationPreferences['radius'])) {
@@ -95,7 +95,7 @@ public function index(Request $request)
9595
'postcode' => $locationPreferences['postcode'] ?? null,
9696
],
9797
'stats' => [
98-
'categories' => Category::whereNull('parent_id')->orderBy('name')->with('children')->get(),
98+
'categories' => null //Category::whereNull('parent_id')->orderBy('name')->with('children')->get(),
9999
],
100100
]);
101101
}

0 commit comments

Comments
 (0)