php-Laravel 5路由未定义,虽然是?
我对应该如何工作感到有些困惑。 但是我收到{!! Form::model(Auth::user(), ['method' => 'PATCH', 'route' => '/preferences/' . Auth::user()->id]) !!}错误。
在我的routes.php中,我有:
{!! Form::model(Auth::user(), ['method' => 'PATCH', 'route' => '/preferences/' . Auth::user()->id]) !!}
在视图文件(account / preferences.blade.php)中,我有:
{!! Form::model(Auth::user(), ['method' => 'PATCH', 'route' => '/preferences/' . Auth::user()->id]) !!}
我收到一条错误消息,告诉我该路线不存在。 我认为我对该主题的文档有误解,但我认为我已使用给定参数定义了PATCH请求的路由,并在视图中正确设置了此路由。
我在这里俯瞰什么?
10个解决方案
79 votes
在表单打开中执行uses时将调用'route' => 'routename'方法,该方法需要所谓的命名路由。 您给路由指定这样的名称:
Route::patch('