0
我有这个路线laravel 5路线传递两个参数
Route::get('/artist/{id}/{name}', '[email protected]')->where(['id' => '[0-9]+', 'name' => '[a-z]+'])->name('artist');
,这是我的链接
<a href="{{route('artist',$artist->id,$artist->name)}}">{{$artist->name}}</a>
,这是HomeController的
public function artist($id, $name){ $artist = Artist::where('id', $id)->where('name', $name)->first();
return view('front.artist', compact('artist'));
}
艺术家方法我DONOT知道此显示错误。这是错误。所以请任何人帮助我。我正在学习laravel。
ErrorException in UrlGenerationException.php line 17:
Missing required parameters for [Route: artist] [URI: artist/{id}/{name}]. (View: C:\xampp\htdocs\laravel\resources\views\front\home.blade.php)
感谢它为我工作 –