laravel 5.5 升级到laravel 5.7 步骤
-
修改
composer.json
"fideloper/proxy": "~3.3", "laravel/framework": "5.5.*",
改为:
"fideloper/proxy": "^4.0", "laravel/framework": "5.7.*",
-
执行命令
composer update
-
修改
app\Http\Middleware\TrustedProxies.php
protected $headers = [ Request::HEADER_FORWARDED => 'FORWARDED', Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', ];
改为:
protected $headers = Request::HEADER_X_FORWARDED_ALL;