Level 46
$categories = Categories::where('parent_id', $category_id)->get();
$products = Products::where('category_id', $category_id)->get();
return view('page', compact('categories', 'products');
1 like
hi i want to create a large ecommerce with many categories and subcatgeories like amazon for instance.when you click on master categories amazon shows a view and renders some contents with links to other subcategories and if you click on a subcategory link you will be shown another view which contains either direct products or subcategories again can any body guide me about this? how they doit ?
$categories = Categories::where('parent_id', $category_id)->get();
$products = Products::where('category_id', $category_id)->get();
return view('page', compact('categories', 'products');
Please or to participate in this conversation.