I'm a little confused on how this is supposed to work. But I'm getting an Route [/preferences/1] not defined
error.
In my routes.php I have:
Route::patch('/preferences/{id}', 'UserController@update');
And in the view file (account/preferences.blade.php) I have:
{!! Form::model(Auth::user(), ['method' => 'PATCH', 'route' => '/preferences/' . Auth::user()->id]) !!}
I'm getting an error telling me the route doesn't exist. I think I'm misunderstanding the docs on this topic but in my opinion I've defined a route for PATCH requests with a given parameter, and set this in the view correctly.
What am I overlooking here?
i had the same issue and find the solution lately.
you should check if your route is rather inside a route::group
like here:
if so you should use it in the view file. like here: