更新时间:2021-08-08 05:02:39
您使用的是哪个laravel
版本?
在低于5.3的版本中,您必须编写如下内容.
In version newer than 5.3, you have to write as follows.
public function boot()
{
//
parent::boot();
Route::model('post', \App\Post::class);
}
参考:
https://readouble.com/laravel/5.3/en/routing.html
https://readouble.com/laravel/5.2/en/routing.html
Explicit Binding
部分.