且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Laravel5`RouteServiceProvider`应该与`错误兼容

更新时间: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部分.