I want to use route model binding, so instead of using Route::resource I tried to define each single route in order to be able to customize the wildcards.
Everything worked fine when I was using
but then I changed to:
and I started getting MethodNotAllowedHttpException in RouteCollection.php line 219 when I try to edit the users.
In the form I use
I ran php artisan route:list for both Route::resource and individual routes and it seems that when I use route::put I don't get PATCH. Does anyone know why this happens and how I can solve this?
Sorry, I'm really new at Laravel and I'm still having trouble understanding the difference between PUT and PATCH. I want to be able to update the user, and I thought that PUT corresponds to the update method and that
is equivalent to
but now I see that was mistaken. So my question is what is the correct way to write the route for the update method?
What you have is fine; but, you have used the PATCH method on your form; change that you PUT also:
{!! Form::model($user, ['method'=>'PUT', ...] !!}
Plenty of reading about the difference between PUT and PATCH if you Google it; I don't know what your app is doing with the request so won't recommend either way.