Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ciurinho's avatar

MethodNotAllowedHttpException on PUT

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?

0 likes
4 replies
tykus's avatar

PUT and PATCH are not synonymous - if you want PATCH then your routing should be explicit

ciurinho's avatar

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?

ciurinho's avatar

Ok, so I figured out that it works with Route::patch, so I guess now I'll have to wrap my head around the difference between PUT and PATCH. Thanks!

tykus's avatar

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.

1 like

Please or to participate in this conversation.