-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
how to create empty cart method? i try to do it, but not successful. pls help me.
here is mine.
here my code:
cart.blade.php
{!! csrf_field() !!}
CartController.php
public function destroy($id)
{
Cart::remove($id);
return redirect('cart')->withSuccessMessage('Item has been removed!');
}
----destroy method above is successful.
public function emptyCart()
{
Cart::destroy();
return redirect('cart')->withSuccessMessage('Your cart his been cleared!');
}
but for empty not .
routes.php
Route::delete('/emptyCart', 'CartController@emptyCart');
Metadata
Metadata
Assignees
Labels
No labels