Upgrade from Laravel 8 to 9
Since Laravel 9 has Symfony 6.0 components and Symfony 6.0 also requires a minimum PHP 8.0, this has resulted in Laravel 9 being able to run on PHP version 8.0 minimum.
Step:1 Remove filedoper/proxy
To remove the filedoper/proxy, please run the below command as laravel 9 did not use filedoper/proxy.
composer remove fideloper/proxy
Step:2 Update/add laravel dependencies.
Go to your composer.json file which is present inside your project root folder.
now do the below changes in your composer.json file
"laravel/framework": "^9.0",
"nunomaduro/collision": "^6.0",
now you have to replace
"facade/ignition": "^2.5", with "spatie/laravel-ignition": "^1.0",
in your application’s composer.json file.
"facade/ignition": "^2.5", //remove
"spatie/laravel-ignition": "^1.0", // add
Step:3 Update Trustedproxy.php middleware
If you are upgrading your Laravel 8 project to Laravel 9 by importing your existing application code into a totally new Laravel 9 application skeleton, you may need to update your application’s “trusted proxy” middleware.
Within your app/Http/Middleware/TrustProxies.php file, update use Fideloper\Proxy\TrustProxies as Middleware to use Illuminate\Http\Middleware\TrustProxies as Middleware.
Next, within app/Http/Middleware/TrustProxies.php, you should update the
$headers property definition:
// Before…
protected $headers = Request::HEADER_X_FORWARDED_ALL;
// After…
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
now you have to run the below command in order to update the dependencies.
composer update
Step:4 Test the integration
To check that your laravel version upgraded to laravel 9, please run the below command
php artisan — version
If you haven’t been able to do these things and you really need them, you can take a look at the Laravel Shift site.