phplaravelpackagecomposer-phpmonolog

Composer dependencies packages conflict while trying to upgrade from Laravel 9 to 10


I'm trying to upgrade from Laravel 9 to Laravel 10 but when I try to update Laravel version the monolog/monolog package conflicts because it's locked to 2.9.1 on my composer.lock file. Tried deleting composer.lock, then doing a require of monolog package to ^3.0 to re-generate composer.lock again with newer version but there's something I must be doing wrong.

On my composer.json if I change laravel/framework to ^10.0 and I do composer update laravel/framework -W I get the following:

Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework[v10.0.0, ..., 10.x-dev] require monolog/monolog ^3.0 -> found monolog/monolog[dev-main, 3.0.0-RC1, ..., 3.x-dev] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires laravel/framework ^10.0 -> satisfiable by laravel/framework[v10.0.0, ..., 10.x-dev].

This is my composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^8.0.2",
        "guzzlehttp/guzzle": "^7.2",
        "inertiajs/inertia-laravel": "^0.6.9",
        "inspector-apm/inspector-laravel": "^4.7",
        "laravel/framework": "^10.0",
        "laravel/jetstream": "^2.7",
        "laravel/sanctum": "^3.2.1",
        "laravel/tinker": "^2.7",
        "manifiesto/dashboard": "^0.4",
        "monolog/monolog": "^2.0|^3.0",
        "pestphp/pest": "^1.16",
        "pestphp/pest-plugin-laravel": "^1.1",
        "sentry/sentry-laravel": "^3.3",
        "tightenco/ziggy": "^1.0"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.6",
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^6.1",
        "phpunit/phpunit": "^9.5.10",
        "spatie/laravel-ignition": "^1.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "repositories": [
        {
            "type": "vcs",
            "url": "git@bitbucket.org:manifiesto/dashboard.git"
        }
    ]
}

So if I do composer why-not spatie/laravel-ignition ^2.0 i get the following:

spatie/laravel-ignition 2.2.0       requires illuminate/support (^10.0) 
laravel/laravel         dev-develop requires laravel/framework (^9.2)   
Not finding what you were looking for? Try calling `composer update "spatie/laravel-ignition:^2.0" --dry-run` to get another view on the problem.

So what makes me being lost here (because I've been stuck with this for several days and I feel stuck and in a loop where everything I try to upgrade depends on another outdated package and I do not progress) is that I can't figure out what I need to upgrade first or the order I should follow. Because I tought at first that spatie/laravel-ignition was the first thing I needed to upgrade but it's also returning me errors when trying to upgrade it.

composer require "spatie/laravel-ignition:>=2.0.0" --with-all-dependencies
./composer.json has been updated
Running composer update spatie/laravel-ignition --with-all-dependencies
Loading composer repositories with package information
Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires spatie/laravel-ignition >=2.0.0 -> satisfiable by spatie/laravel-ignition[2.0.0, ..., 2.2.0].
    - tightenco/ziggy is locked to version v1.6.0 and an update of this package was not requested.
    - tightenco/ziggy v1.6.0 requires laravel/framework >=5.4@dev -> satisfiable by laravel/framework[v9.2.0, ..., v9.52.10].
    - Only one of these can be installed: illuminate/support[v9.0.0, ..., v9.52.10, v10.0.0, ..., v10.14.1], laravel/framework[v9.47.0, ..., v9.52.10]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
    - Conclusion: install illuminate/support v10.14.1 (conflict analysis result)


Installation failed, reverting ./composer.json and ./composer.lock to their original content.
composer require illuminate/support:10.14.1 && composer update illumiante/support
./composer.json has been updated
Running composer update illuminate/support
Loading composer repositories with package information
Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires illuminate/support 10.14.1, found illuminate/support[v10.14.1] but these were not loaded, likely because it conflicts with another require.


Installation failed, reverting ./composer.json and ./composer.lock to their original content.
composer why illuminate/support
barryvdh/laravel-debugbar       v3.8.1   requires illuminate/support (^9|^10)                            
inspector-apm/inspector-laravel 4.7.31   requires illuminate/support (^5.5|^6.0|^7.0|^8.0|^9.0|^10.0)    
laravel/fortify                 v1.17.4  requires illuminate/support (^8.82|^9.0|^10.0)                  
laravel/framework               v9.52.10 replaces illuminate/support (self.version)                      
laravel/jetstream               v2.16.2  requires illuminate/support (^9.21|^10.0)                       
laravel/sail                    v1.23.0  requires illuminate/support (^8.0|^9.0|^10.0)                   
laravel/sanctum                 v3.2.5   requires illuminate/support (^9.21|^10.0)                       
laravel/tinker                  v2.8.1   requires illuminate/support (^6.0|^7.0|^8.0|^9.0|^10.0)         
sentry/sentry-laravel           3.6.0    requires illuminate/support (^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0) 
spatie/laravel-ignition         1.6.4    requires illuminate/support (^8.77|^9.27)
composer update spatie/laravel-ignition -W
Loading composer repositories with package information
Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires spatie/laravel-ignition ^2.0 -> satisfiable by spatie/laravel-ignition[2.0.0, ..., 2.2.0].
    - tightenco/ziggy is locked to version v1.6.0 and an update of this package was not requested.
    - tightenco/ziggy v1.6.0 requires laravel/framework >=5.4@dev -> satisfiable by laravel/framework[v9.2.0, ..., v9.52.10].
    - Only one of these can be installed: illuminate/support[v9.0.0, ..., v9.52.10, v10.0.0, ..., v10.14.1], laravel/framework[v9.47.0, ..., v9.52.10]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
    - Conclusion: install illuminate/support v10.14.1 (conflict analysis result)

Trying to update spatie/laravel-ignition and illuminate/support at the same time just gives me this:

composer update -W illuminate/support spatie/laravel-ignition

Loading composer repositories with package information
Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires illuminate/support ^10.0 -> satisfiable by illuminate/support[v10.0.0, ..., v10.14.1].
    - inertiajs/inertia-laravel v0.6.9 requires laravel/framework ^6.0|^7.0|^8.74|^9.0|^10.0 -> satisfiable by laravel/framework[v9.52.0, ..., v9.52.10].
    - Only one of these can be installed: illuminate/support[v10.0.0, ..., v10.14.1], laravel/framework[v9.52.0, ..., v9.52.10]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
    - inertiajs/inertia-laravel is locked to version v0.6.9 and an update of this package was not requested.

Solution

  • It seems I partially solved it. Managed to upgrade Laravel to ^10.0 and 'spatie/laravel-ignition' to ^2.0` it seems I just had to remove 'monolog/monolog', 'spatie/laravel-ignition' and 'illuminate/support'. Now I just need to make sure I update as intented the dependency package that we use that also has some Laravel packages outdated. Thanks anyway for the help. I'll close this and mark it as solved once I finish to upgrade all and make sure there's no more conflicts.