php - Installation failed, reverting ./composer.json and ./composer.lock to their original content

I try to install
composer require gloudemans/shoppingcart
package to my laravel project. But i Keep receive this error
Root composer.json requires gloudemans/shoppingcart ^2.6 -> satisfiable by gloudemans/shoppingcart[2.6.0]. - gloudemans/shoppingcart 2.6.0 requires illuminate/support 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.|| 5.6. || 5.7.* -> found illuminate/support[v5.1.1, ..., 5.7.x-dev] but it conflicts with another require.
Composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.12",
"laravel/tinker": "^2.5"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/ui": "^3.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
I am a beginner in laravel. Hope anyone provide the solution. Thanks in advance.
Answer
Solution:
As written in the error message:gloudemans/shoppingcart
is not compatible with Laravel 8, which you already use in your application.hardevine/shoppingcart
orbumbummen99/shoppingcart
seem to be forks that were made compatible with any Laravel version since v5.1
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: malformed utf-8 characters, possibly incorrectly encoded
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.