当我尝试访问页面时,我错过了参数1错误。这是我的代码。
部分观点:
@foreach($stations as $station)
<span> {{ $stations->station }} </span>
@endforeach
控制器:
public function show($id)
{
$stations = DB::table('stations')->pluck('station');
return view('configuration.configuration', $stations);
}
路线:
Route::get('configuration/', 'ConfigurationController@show');
答案 0 :(得分:2)
从$id
函数声明中删除show
:
public function show() {
$stations = DB::table('stations')->pluck('station');
return view('configuration.configuration', $stations);
}