Laravel : installation shoppingcart failed

  Kiến thức lập trình

//my composer.json

{
    "name": "laravel/laravel",
    "version": "11",
    "type": "project",
    "description": "The skeleton application for the Laravel framework.",
    "keywords": ["laravel", "framework"],
    "license": "MIT",
    "require": {
        "php": "^8.2",
        "guzzlehttp/guzzle": "^7.8",
        "laracasts/flash": "^3.2",
        "laravel/framework": "^11.9",
        "laravel/tinker": "^2.9"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.26",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.0",
        "phpunit/phpunit": "^11.0.1"
    },

//my command prompt

C:Usersprojeteshop>composer require gloudemans/shoppingcart
./composer.json has been updated
Running composer update gloudemans/shoppingcart
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
 
  Problem 1
    - gloudemans/shoppingcart[1.0, ..., 1.2.1] require illuminate/support ~4 -> found illuminate/support[v4.0.0, ..., v4.2.17] but these were not loaded, likely because it conflicts with another require.
    - gloudemans/shoppingcart 1.3 requires illuminate/support ~5.0 -> found illuminate/support[v5.0.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require.
    - gloudemans/shoppingcart[2.0.0, ..., 2.1.2] require illuminate/support 5.1.*|5.2.* -> found illuminate/support[v5.1.1, ..., v5.2.45] but these were not loaded, likely because it conflicts with another require.
    - gloudemans/shoppingcart[2.2.0, ..., 2.2.4] require illuminate/support 5.1.*|5.2.*|5.3.* -> found illuminate/support[v5.1.1, ..., v5.3.23] but these were not loaded, likely because it conflicts with another require.
    - gloudemans/shoppingcart 2.3.0 requires illuminate/support 5.1.*|5.2.*|5.3.*|5.4.* -> found illuminate/support[v5.1.1, ..., v5.4.36] but these were not loaded, likely because it conflicts with another require.
    - gloudemans/shoppingcart 2.4.0 requires illuminate/support 5.1.*|5.2.*|5.3.*|5.4.*|5.5.* -> found illuminate/support[v5.1.1, ..., v5.5.44] but these were not loaded, likely because it conflicts with another require.
    - gloudemans/shoppingcart 2.5.0 requires illuminate/support 5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.* -> found illuminate/support[v5.1.1, ..., v5.6.39] but these were not loaded, likely because it conflicts with another require.
    - 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, ..., v5.7.28] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires gloudemans/shoppingcart * -> satisfiable by gloudemans/shoppingcart[1.0, ..., 1.3, 2.0.0, ..., 2.6.0].
 
You can also try re-running composer require with an explicit version constraint, e.g. "composer require gloudemans/shoppingcart:*" to figure out if any version is installable, or "composer require gloudemans/shoppingcart:^2.1" if you know which you need.
 
Installation failed, reverting ./composer.json and ./composer.lock to their original content.

For my e-shop project, i need to add a product to cart. I ran composer require g loudemans/shoppingcart and i got this Installation failed, reverting ./composer.json and ./composer.lock to their original content

I understand that this dependency is too old but how can i fix it please ? I read many topics on internet with no results. Thank you for your help and sorry for my english.

New contributor

lara is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT