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 index()
    {
        $cart = Cart::instance(Auth::user()->id)->content();
        $total = 0;
        foreach ($cart as $c) {
            $total += $c->qty * $c->price *1.08;
        }
        return view('carts.index', compact('cart', 'total'));
    }
public function index ( ) { $ cart = Cart :: instance ( Auth :: user ( ) -> id ) -> content ( ) ; $ total = 0 ; foreach ( $ cart as $ c ) { $ total += $ c -> qty * $ c -> price * 1.08 ; } return view ( 'carts.index' , compact ( 'cart' , 'total' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .