App \ Http \ Controllers \ ConfigurationController :: show()缺少参数1

时间:2016-07-15 09:28:34

标签: php laravel laravel-5.1 laravel-routing

当我尝试访问页面时,我错过了参数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');

1 个答案:

答案 0 :(得分:2)

$id函数声明中删除show

public function show() {
    $stations = DB::table('stations')->pluck('station');
    return view('configuration.configuration', $stations);
}