自定义路由模型绑定
public function boot() {
// Just allows the parent's boot() method to still run
parent::boot();
// Perform the binding
Route::model('event', Conference::class);
}Route::get('events/{event}', function (Conference $event) {
return view('events.show')->with('event', $event);
});Last updated