Marwan Mohamed
Marwan Mohamed

Reputation: 25

upgrade from laravel 7 to laravel 8

I am trying to upgrade from laravel 7 to 8 bug i got the error

Your requirements could not be resolved to an installable set of packages.

Problem 1

- Conclusion: don't install laravel/framework v8.0.1 (conflict analysis result)
- Conclusion: don't install laravel/framework v8.0.2 (conflict analysis result)
- Conclusion: don't install laravel/framework v8.0.3 (conflict analysis result)
- Conclusion: don't install laravel/framework v8.33.0 (conflict analysis result)
- Conclusion: don't install laravel/framework v8.33.1 (conflict analysis result)
- laravel/horizon[v4.0.0, ..., v4.3.5] require illuminate/support ^7.0 -> satisfiable by illuminate/support[v7.0.0, ..., v7.30.4].
- Only one of these can be installed: illuminate/support[v5.0.0, ..., v5.8.36, v6.0.0, ..., v6.20.19, v7.0.0, ..., v7.30.4, v8.0.0, ..., v8.33.1], laravel/framework[v8.0.0, ..., v8.33.1]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
- Root composer.json requires laravel/framework ^8.0 -> satisfiable by laravel/framework[v8.0.0, ..., v8.33.1].
- Root composer.json requires laravel/horizon ^4.0 -> satisfiable by laravel/horizon[v4.0.0, ..., v4.3.5].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

my composer

 "require": {
    "php": "^7.2",
    "creativeorange/gravatar": "~1.0",
    "doctrine/dbal": "^2.5",
    "facade/ignition": "^2.3.6",
    "fideloper/proxy": "~4.0",
    "fruitcake/laravel-cors": "^2.0",
    "guzzlehttp/guzzle": "^7.0.1",
    "laravel/framework": "^8.0",
    "laravel/helpers": "^1.1",
    "laravel/horizon": "^4.0",
    "laravel/sanctum": "^2.3",
    "laravel/tinker": "^2.0",
    "laravel/ui": "^3.0",
    "predis/predis": "^1.1",
    "spatie/laravel-backup": "^6.10",
    "spatie/laravel-permission": "^3.6",
    "yajra/laravel-datatables-fractal": "^1.6",
    "yajra/laravel-datatables-oracle": "^9.0"
},
"require-dev": {
    "composer/composer": "^1.9",
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "~1.0",
    "nunomaduro/collision": "^5.0",
    "phpunit/phpunit": "^9.0"
},

what is the error , how can i fix it ?

Upvotes: 1

Views: 2198

Answers (3)

Krina Mangukiya
Krina Mangukiya

Reputation: 426

You have to follow the steps provided below from scratch:

  1. Backup Your composer.json:

    • Make a backup of your current composer.json file just to be safe.
  2. Update composer.json:

  3. Update Exception Handler:

  4. Run composer update:

    • Run the command composer update in your project's root directory.
  5. Check for New Packages:

    • Take a look at your old composer.json file. if packages have been added to it, you can install them using the command composer require <package name>.
  6. Update Composer Again:

    • Lastly, run the command composer update again to ensure everything is up to date.

Upvotes: 0

Rose Riyadh
Rose Riyadh

Reputation: 668

I have used composer install --ignore-platform-reqs and then php artisan serve and it worked for me.

But before we got to this I have updated PHP and Laravel in composer.json to the versions I needed.

Upvotes: 0

Nico Haase
Nico Haase

Reputation: 12093

The error message is pretty clear:

  • laravel/horizon[v4.0.0, ..., v4.3.5] require illuminate/support ^7.0 -> satisfiable by illuminate/support[v7.0.0, ..., v7.30.4].

You also need to update all other packages, like laravel/horizon. Currently, you require v4 which is not compatible with Laravel 8. Update that package to v5 which is compatible with Laravel 8.

Upvotes: 4

Related Questions