Sunday, March 19, 2017

Laravel Delete Method: MethodNotAllowedHttpException in RouteCollection.php line 233:

I tried to delete cart from a list..when i tried to delete it, it shows the Above Error.

Here is my controller, view part and method

Route::post('cart/delete/{id}','ProductController@deleteCart');



 <a href="" class="remove_item">
                                           <i class="fa fa-times"></i>
                                        </a>

                                    <form  action="" method="POST" style="display: none;">
                                            {!! Form::hidden('id',$row->id) !!}
                                    </form>

public function deleteCart($id){
        $cart = Cart::find($id);
        $cart->destroy();
        return Redirect::to('/shop-cart'); 
    }



via User57

Advertisement