此操作記錄基于Laravel 5.5升級到Laravel 5.7,我們需要修改composer.json文件,將:
"laravel/framework": "5.5.*",
修改為:
"laravel/framework": "5.7.*",
執(zhí)行命令:
$ composer update
出錯小插曲:
更新過程中報了以下錯誤:
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依賴包版本過低導致,修改:
"fideloper/proxy": "~3.3",
為:
"fideloper/proxy": "^4.0",
錯誤2:
Class 'App\Providers\Schema' not found
use Illuminate\Support\Facades\Schema;
重新運行更新命令,Laravel 5.7升級成功。