laravel 5.5升级6.0
直接复制6.0 composer.json替换之前
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5|^8.0",
"fideloper/proxy": "^4.4",
"laravel/framework": "^6.20.26",
"laravel/tinker": "^2.5"
},
"require-dev": {
"facade/ignition": "^1.16.15",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.5.8|^9.3.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
执行
composer update
--------------------------------------------
问题:出现报错
In cache.php line 91:
Call to undefined function str_slug()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
解决方法:因为使用use Illuminate\Support\Str; 替换现在str_slug,
直接找到https://github.com/laravel/laravel/blob/6.x/config/cache.php 替换对应目录下cache.php文件
同样问题出现config/session.php,
--------------------------------------------------------------
其它代码对应升级找到版本
Zizaco/entrust已经没有支持laravel6.0以上版本
使用https://github.com/jromero98/entrust/tree/2.0代替,详细可以参考文档
如果
composer require trebol/entrust:0.6
出现错误
使用,忽略php强制要求
composer require trebol/entrust:0.6 --ignore-platform-reqs
无评论