app/Http/Controllers/CartController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function cart()
    {
        $image = Image::all();
        if(Session::has('cart')){
            $oldCart = Session('cart')?Session::get('cart'):null;
            $cart = new Cart($oldCart);
            $cart = Session::get('cart');
            $totalPrice = $cart->totalPrice;
            $sp = $cart->items;
            return view('customer.page.cart',['product'=>$sp,'img'=>$image,'totalPrice'=>$totalPrice]);
        }
        return view('customer.page.cart',['product'=>$sp,'img'=>$image]);
    }
public function cart ( ) { $ image = Image :: all ( ) ; if ( Session :: has ( 'cart' ) ) { $ oldCart = Session ( 'cart' ) ? Session :: get ( 'cart' ) : null ; $ cart = new Cart ( $ oldCart ) ; $ cart = Session :: get ( 'cart' ) ; $ totalPrice = $ cart -> totalPrice ; $ sp = $ cart -> items ; return view ( 'customer.page.cart' , [ 'product' => $ sp , 'img' => $ image , 'totalPrice' => $ totalPrice ] ) ; } return view ( 'customer.page.cart' , [ 'product' => $ sp , 'img' => $ image ] ) ; }
Display a listing of the resource.
Display a listing of the resource .
//