Laravel从5.1错误升级到5.2.0 [英] Laravel Upgrading To 5.2.0 From 5.1 error
问题描述
在composer update
命令上获取错误.
我的composer.json文件是:
My composer.json file is:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"illuminate/html": "^5.0",
"barryvdh/laravel-debugbar": "~2.0",
"spatie/laravel-paginateroute": "^2.0",
"darkaonline/l5-swagger": "~2.0",
"yajra/laravel-datatables-oracle": "~5.0",
"phpoffice/phpexcel": "^1.8"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"symfony/dom-crawler": "~3.0",
"symfony/css-selector": "~3.0"
},
"autoload": {
"classmap": [
"database"
],
"files": ["app/Helpers/helpers.php"],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
推荐答案
您需要删除此过时的软件包(从核心中删除,不再受支持):
You need to remove this outdated package (taken out of the core and no longer supported):
"illuminate/html": "^5.0",
删除时,还需要删除其服务提供商/别名.因此,如果打开config/app.php
,将看到提供程序和别名部分.如果还没有的话,请删除这些代码行.
When you remove it, you need to also remove its service providers / aliases. So, if you open up config/app.php
, you will see a providers and aliases section. Remove these lines of code if you haven't done so already.
'Illuminate\Html\HtmlServiceProvider'
'Form'=> 'Illuminate\Html\FormFacade',
'HTML'=> 'Illuminate\Html\HtmlFacade',
代替它,您应该安装Laravel Collective软件包.要安装该软件包,请使用以下内容替换illuminate/html
软件包:
In place of it, you should install the Laravel collective package. To install that, replace the illuminate/html
package with this:
"laravelcollective/html": "5.2.*"
然后在您的config/app.php
文件中,将其添加到您的provider数组中:
Then in your config/app.php
file, add this to your providers array:
Collective\Html\HtmlServiceProvider::class
,并将其添加到别名数组:
and this to your aliases array:
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
可在此处找到文档: https://laravelcollective.com/docs/5.2/html
这篇关于Laravel从5.1错误升级到5.2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!