Support the ongoing development of Laravel.io →
Requests Eloquent Forms
Last updated 2 years ago.
0

Show me your routes

0

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

0

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');
Last updated 8 years ago.
0

i am using a resource route so that does not apply in my case

Route::resource('LeadsController');
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jcamilo93 jcamilo93 Joined 27 Dec 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.