public function allcategory() { $products = product::get(); // get all product $category = category::get(); $id = "All Products"; return view('Pages.products', compact('products', 'category', 'id')); // return products to index page }
public function add_Product() { if (\Auth::guest()) { return redirect('auth/login'); } $categories = category::get(); // get all product return view('backoffice.cart_add_Products', compact('categories')); }