Upgrade Laravel project from 5.5 to latest version 8

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company
Title: Upgrade Laravel Project from 5.5 to Latest Version 8 Step by Step Guide Introduction: Upgrading your Laravel project can be a tedious but necessary task if you want to keep up with the latest features and security updates. In this comprehensive guide, we'll discuss how to upgrade from Laravel 5.5 to the latest version 8 in a step-by-step manner while also providing detailed information on the configuration files involved. Upgrading Composer Dependencies: To begin the process, update your dependencies by running composer to install all required packages. It is highly recommended that you specify the target Laravel package version. For instance, for Laravel 7, you'll need something like this: `composer require laravel/framework:^7.0`. When working with Laravel 8, it would be `laravel/laravel`. Configuring Autoloader: After the installation is complete, check your composer.json file to ensure that the correct autoloading settings are maintained for each Laravel version. For example, in 5.5, you'll have:
{
"autoload": {
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
}
}
For Laravel 8, you'll have:
{
"autoload": {
    "psr-4": {
        "App\\": "app/"
    },
    "classmap": [
        "database/seeds",
        "database/factories"
    ]
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
}
}
Note that Laravel 7 has changed the configuration slightly compared to version 5.5 and added "classmap" for database seeds and factories. Configure Preferred Installation Type: Another crucial step is configuring your preferred installation type. In the composer.json file, there's a section named 'preferred-install':
{
"config": {
    "preferred-install": "dist",
    ...
}
For Laravel 7 and above, this value is also set to "dist". Make sure it remains consistent throughout your project. Upgrade Appropriate Packages: As you upgrade from one Laravel version to another, certain packages may need upgrading as well. Check the composer.json file for any required updates or new dependencies. For instance, for Laravel 5.5, you might have:
{
"require": {
    "fideloper/proxy": "~3.3",
    ...
}
For Laravel 7 or above:
{
"require": {
    "fideloper/proxy": "^4.2",
    ...
}
Upgrade Composer Scripts: Finally, update your composer.json file's "scripts" section based on the Laravel version you are upgrading to. For instance, for Laravel 5.5, it would be:
{
"scripts": {
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    ...
}
}
For Laravel 7, your scripts section will be updated as:
{
"scripts": {
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover --ansi"
    ],
    ...
}
}
Conclusion: Upgrading from Laravel 5.5 to the latest version involves several changes in your configuration files. Ensure that you follow each step carefully and maintain consistency, as it will guarantee a smooth transition with no conflicts along the way. For any further assistance, feel free to reach out to our experts at https://laravelcompany.com/ for Laravel development services or support.