RouteServiceProvider :: boot()Laravel 5.6

时间:2018-11-28 11:30:09

标签: php laravel

我正在用Laravel 5.6开发一个Web应用程序,当我写“ php artisan serve”时,出现错误提示。

  

在LaravelShopProvider.php第130行中:    声明Amsgames \ LaravelShop \ LaravelShopProvider :: boot(Illuminate \ Routing \ Router $ router)应该兼容     与Illuminate \ Foundation \ Support \ Providers \ RouteServiceProvider :: boot()

这是RouteServiceProvider.php文件中的启动功能

public function boot()
{
    /*
     * Register route model bindings
     */

    /*
     * This allows us to use the Route Model Binding with SoftDeletes on
     * On a model by model basis
     */
    $this->bind('deletedUser', function ($value) {
        $user = new User();

        return User::withTrashed()->where($user->getRouteKeyName(), $value)->first();
    });


    parent::boot();

}

0 个答案:

没有答案