gpt4 book ai didi

laravel - 调用未定义的方法 Illuminate\Foundation\Application::bindShared()

转载 作者:行者123 更新时间:2023-12-03 21:08:12 27 4
gpt4 key购买 nike

我刚刚将 Laravel 从 5.0 升级到 5.1。

我收到此错误:

Call to undefined method Illuminate\Foundation\Application::bindShared()

因此,经过一番搜索,我需要将 bindShared 更改为单例。

我可以在 vendor/illuminate/html/HtmlServiceProvider.php 中做到这一点

问题是,当另一个开发人员在项目上工作并执行 Composer 安装,或者我部署到服务器时会发生什么。

如何保留对供应商文件夹中文件的更改?

最佳答案

Illuminate/html被遗弃。使用Collective/html反而。

要安装它,请使用以下

composer require "laravelcollective/html":"^5.2.0"

然后在 app/app.php 文件中更改/添加如下
对于提供者
Collective\Html\HtmlServiceProvider::class

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

关于laravel - 调用未定义的方法 Illuminate\Foundation\Application::bindShared(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31250211/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com