1

i tried these two methods..

first one : MethodNotAllowedHttpException

Route::post('/settings/{id}/update/', 'HomeController@update'); Route::match(['put','patch'], '/settings/{id}/update/','HomeController@update') use this also..

{!! Form::model($user, ['method' => 'patch','action' => ['HomeController@update',$user->id]]) !!}

another one

{!! Form::model($user, ['method' => 'patch','route' => ['user.update',$user->id]]) !!}

please explain how to use route for update default auth users.

Chandhru Sekar
  • 308
  • 2
  • 9

2 Answers2

1

You should give a name to the route:

Route::patch('/settings/{id}/update/', 'HomeController@update')->name('user.update');

Or:

Route::patch('/settings/{id}/update/', ['as' => 'user.update', 'uses' => 'HomeController@update']);
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279
0

I think you should just be specific about the method you want to use, be it put or patch and also If i remember correctly, if you have to use patch method referencing the answer from this post: Laravel form won't PATCH, only POST - nested RESTfull Controllers, MethodNotAllowedHttpException

<form method="POST" action="patchlink">
     {!! method_field('patch') !!}
     . . .
</form>

The method field is required because as I understood, Laravel uses this mechanism to handle patch request.

PS: What I just tried to highlight if I understood correctly is that, there should be an extra field to handle the patch method. Hope this helps :)

Community
  • 1
  • 1