with('children')->where('is_active', true)->get(); return view('category::index', compact('categories')); } public function show(Category $category) { $listings = $category->listings()->where('status', 'active')->paginate(12); return view('category::show', compact('category', 'listings')); } }