Php Laravel5.2-添加laravelcollective/HTML5.2会引发错误

Php Laravel5.2-添加laravelcollective/HTML5.2会引发错误,php,symfony,laravel-5,Php,Symfony,Laravel 5,我使用的是Laravel v5.2,并按照以下说明安装了laravelcollective/html,但它仍然会抛出错误: Browser:ProviderRepository.php第119行中的FatalErrorException:调用未定义的方法Collective\Html\FormFacade::isDeferred() Artisan:[Symfony\Component\Debug\Exception\FatalErrorException]调用未定义的方法Collective\

我使用的是Laravel v5.2,并按照以下说明安装了laravelcollective/html,但它仍然会抛出错误:

Browser:ProviderRepository.php第119行中的FatalErrorException:调用未定义的方法Collective\Html\FormFacade::isDeferred()

Artisan:[Symfony\Component\Debug\Exception\FatalErrorException]调用未定义的方法Collective\Html\FormFacade::isDeferred()

还尝试了5.2.*-dev,但出现了相同的错误

希望有人能帮忙

命令:

composer require laravelcollective/html
添加到composer.json“require”组:

添加到提供者组中的config/app.php:

Collective\Html\HtmlServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
在别名组中:

'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,

我希望现在还不算太晚,但也许你们问题的答案会对以后的参考有用。下面是一步一步:

1) 在laravel软件包的根目录中,应将“require”组中的open composer.json文件添加到以下行:

"laravelcollective/html": "5.2.*"
它应该类似于: “要求”:{ “php”:“>=5.5.9”, “laravel/框架”:“5.2.”, “laravelcollective/html”:“5.2” },

2) 打开命令提示符或Git Bash,并使用以下命令更新编写器:

composer update
作曲家将在大约一两分钟内更新

3) 打开config/app.php在providers组中添加此行:

Collective\Html\HtmlServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
别忘了用逗号分隔上一个类。它应该是这样的:

Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
'View' => Illuminate\Support\Facades\View::class,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
4) 在“别名”组中的同一文件中,添加以下别名:

'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
所以它应该看起来像:

Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
'View' => Illuminate\Support\Facades\View::class,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,

我希望这对任何使用Laravel 5.2.*

的人都会有所帮助。您检查过供应商目录中是否存在实际的类文件吗?是的,类文件在那里。您能显示您试图调用的函数的源代码吗?呵呵。还没走那么远。这只是初始设置。我正在做一个教程(),第2部分从要求laravelcollective/html开始。作者使用的是5.0,我使用的是5.2。也许我应该重新开始使用L5.0。谢谢你的回复,RCrowt。就我而言,这是一个愚蠢的错误——我在“服务提供商”下使用了外观,而不是别名。