I working on a simple laravel 5.2 application. I want to pass a value $id
from the view when a button is clicked to the controller method destroy()
. This is what i have tried:
This is my route
Route::get('delete/{id}', array('as' => 'delete', 'uses' => 'ContactsController@destroy'));
... and this is my button in a view:
<a href="{{ action('ContactsController@destroy/{$contacts->id}/') }}" class="btn btn-danger">Delete</a>
But this code didn't work. Thanks for any help.
According to the documentation you should be able to do this: