Reputation: 11267
Route::delete('/news/{id}', 'NewsController@destroy');
Upvotes: 4
Views: 8398
Reputation: 1076
You can't use anchor tag with href to send the request to delete. You need a form todo so. With a method DELETE since in form we have only get and post so create a hidden field with name _method and value DELETE Create form similar to this :
<form action="news/id" method="post">
<input type="hidden" name="token" value="{{csrf_token}}" >
<input type="hidden" name="_method" value="DELETE" >
<input type="submit" value="delete " >
</form>
Upvotes: 5
Reputation: 670
Route::resource('/news/{id}', 'NewsController@destroy');
and then select post, put, delete ...
Upvotes: 2