未定义路由[foo / 1 / bar]。在resources / views / bar / create.blade.php中找到
这是在routes / web.php中;
Route::post('/foo/{client}/bar', 'BarController@store');
这是引起问题的行;
form action="{{ route('foo/'.$client->id.'/bar') }}" method="POST" enctype="multipart/form-data">
答案 0 :(得分:3)
该怎么办
cfg.CreateMap<ObjectA, ViewModelA>()
.ForMember(dest => dest.StartPage, opt => opt.MapFrom<CustomResolver>())
因为您没有这样定义名称路由
form action="{{ url('foo/'.$client->id.'/bar') }}" method="POST" enctype="multipart/form-data">
答案 1 :(得分:1)
想通了!
我改变了
Route::post('/foo/{client}/bar', 'BarController@store');
收件人
Route::post('/foo/{client}/bar', 'BarController@store')->name('bar_post');
还有这个
form action="{{ route('foo/'.$client->id.'/bar') }}" method="POST" enctype="multipart/form-data">
对此
form action="{{ route('bar_post', ['client', $client->id]) }}" method="POST" enctype="multipart/form-data">