/**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     $cart = new Cart();
     view()->share('categories', tbl_categories::all());
     view()->share('cart_count', $cart->count());
 }
Example #2
0
 public function getRemove(Request $request)
 {
     $cart = new Cart();
     $cart->remove($request->product_id);
     return response()->json(['cart_count' => $cart->count(), 'cart_total' => $cart->getTotal()]);
 }
 public function getItemCartCount()
 {
     $cart = new Cart();
     $itemsCount = $cart->count();
     return Response::json(array('success' => true, 'data' => $itemsCount));
 }