此操作記錄基于Laravel 5.5升級(jí)到Laravel 5.7,我們需要修改composer.json文件,將:
"laravel/framework": "5.5.*",
修改為:
"laravel/framework": "5.7.*",
執(zhí)行命令:
$ composer update
出錯(cuò)小插曲:
更新過(guò)程中報(bào)了以下錯(cuò)誤:
In trustedproxy.php line 66:
Undefined class constant 'HEADER_CLIENT_IP'
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
檢查發(fā)現(xiàn)是fideloper/proxy依賴(lài)包版本過(guò)低導(dǎo)致,修改:
"fideloper/proxy": "~3.3",
為:
"fideloper/proxy": "^4.0",
錯(cuò)誤2:
Class 'App\Providers\Schema' not found
use Illuminate\Support\Facades\Schema;
重新運(yùn)行更新命令,Laravel 5.7升級(jí)成功。