Thanks mirbatworks but I figured it out, for future reference my form should have been like this:
<form action="{{action('LeadsController@update',['id'=>$lead->id])}}" method="post">
<input type="hidden" name="_method" value="put" />
method put is no valid for forms, instead I have to use POST and send a hidden field named _method with the value put
Thanks anyway
If you have in controller route with { id } Something like this:
Route::get('leads/{id}', 'LeadsController@show');
Route::get('leads/update', 'LeadsController@update');
Your controller will always load show method even if your url is leads/update because of your {id}
In that case you need to change sequences
//first:
Route::get('leads/update', 'LeadsController@update');
// than:
Route::get('leads/{id}', 'LeadsController@show');
i am using a resource route so that does not apply in my case
Route::resource('LeadsController');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community