Reputation: 43
So i have this delete form
<form action="/remove-cart/{{ $item->rowId}}" method="POST">
@method('DELETE')
@csrf
<input type="submit" value="Remove item">
</form>
which goes to this route
Route::delete('/remove-cart/{$id}', 'CartController@removeCart');
which is supposed to go to a method
public function removeCart($id){
return $id;
}
but the method is not reached, i get a 404 page not found with url showing http://project.dev/remove-cart/123 (123 is the value of $item->rowId)
What am i doing wrong here?
Upvotes: 3
Views: 1328
Reputation: 1835
Please try Route::delete('/remove-cart/{id}', 'CartController@removeCart');
instead {$id}
Upvotes: 3