看来参数没有通过,但经过各种编辑没有运气,也没办法将其剥离。
错误:
Missing required parameters for [Route: request.new-request]
[URI: housing-request/{unit}].
(View: /vhosts/web.local/resources/views/requests/unit-1.blade.php)
链接/ URL:
<a href="{{ route('request.new-request', ['unit' => 'single']) }}">
http://web.local/housing-request/single
路线:
Route::get('/housing-request/{unit}', 'RequestsController@showHousingUnit')->name('request.new-request');
控制器:
public function showHousingUnit($unit)
{
if($unit == "single"){
return view('requests.unit-1');
} else if($unit == "double") {
return view('requests.unit-2');
}
}
答案 0 :(得分:0)
就这样通过。
<a href="{{ route('request.new-request','single') }}">
http://web.local/housing-request/single </a>
答案 1 :(得分:0)
错误发生在视图中缺少参数
的路径上