app/Http/Controllers/CartController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request)
    {
        if( $request->action = "update"){
            Cart::instance(Auth::user()->id)->update($request->id, $request->qty);
        } else {
            Cart::instance(Auth::user()->id)->remove($request->id);
        }
        return redirect()->route('carts.index');
    }
public function update ( Request $ request ) { if ( $ request -> action = " update " ) { Cart :: instance ( Auth :: user ( ) -> id ) -> update ( $ request -> id , $ request -> qty ) ; } else { Cart :: instance ( Auth :: user ( ) -> id ) -> remove ( $ request -> id ) ; } return redirect ( ) -> route ( 'carts.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .