vendredi 13 juillet 2018

cart::remove not working i am using crinsane shopping cart library

Here's my code:

web.php

Route::delete('/cart/{$product}', 'CartController@destroy')->name('cart.destroy');

cart.blade.php

<form action="" method="POST">
    <input type="hidden" name="_method" value="DELETE">
    <button type="submit" class="cart-options">Remove</button>
</form>

CartController.php

public function destroy($id)
{
   Cart::remove($id);

   return back();
}

when I submit the form I am seeing a blank page with this:

Sorry the page you are looking not found



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire