如何解决错误迁移对未定义方法Illuminate \ Session \ Store :: getToken的调用?

时间:2019-01-07 08:46:07

标签: laravel-5

我尝试将laravel 5.0应用程序更新到5.7,并逐步移动,但由于错误我被停止了:

    Call to undefined method Illuminate\Session\Store::getToken() (View: /var/www/html/YoutubeAPI_Demo-57/resources/views/videos.blade.php)

in HtmlServiceProvider.php line 51
at CompilerEngine->handleViewException(object(FatalThrowableError), 1)

我找到了文件:

vendor/illuminate/html/HtmlServiceProvider.php with method which triggered error: 
    /**
     * Register the form builder instance.
     *
     * @return void
     */
    protected function registerFormBuilder()
    {
        $this->app->singleton('form', function($app)
        {
            $form = new FormBuilder($app['html'], $app['url'], $app['session.store']->getToken());

            return $form->setSessionStore($app['session.store']);
        });
    }

您能否提示如何解决此错误?

谢谢!

1 个答案:

答案 0 :(得分:0)

尝试将getToken()替换为token()