4
votes

When I do composer require laravel/passport, I get

Using version ^5.0 for laravel/passport ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1 - Installation request for laravel/passport ^5.0 -> satisfiable by laravel/passport[v5.0.0]. - Conclusion: remove laravel/framework v5.5.34 - Conclusion: don't install laravel/framework v5.5.34 - laravel/passport v5.0.0 requires illuminate/encryption ~5.6 -> satisfiable by illuminate/encryption[v5.6.0, v5.6.1, v5.6.2, v5.6.3]. - don't install illuminate/encryption v5.6.0|don't install laravel/framework v5.5.34 - don't install illuminate/encryption v5.6.1|don't install laravel/framework v5.5.34 - don't install illuminate/encryption v5.6.2|don't install laravel/framework v5.5.34 - don't install illuminate/encryption v5.6.3|don't install laravel/framework v5.5.34 - Installation request for laravel/framework (locked at v5.5.34, required as 5.5.*) -> satisfiable by laravel/framework[v5.5.34].

Installation failed, reverting ./composer.json to its original content.

I think this means that my version of illuminate/encryption is not compatible with this version of laravel/passport

Is that correct? What is the best way to resolve this? I can't even figure out how to see what version of illuminate/encryption I have. It doesn't show up in composer show.

Here is my composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.0.0",
        "fideloper/proxy": "~3.3",
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0",
        "tymon/jwt-auth": "dev-develop"
    },
    "require-dev": {
        "filp/whoops": "~2.0",
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "~1.0",
        "phpunit/phpunit": "~6.0",
        "symfony/thanks": "^1.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    }
}
2

2 Answers

10
votes

Passport 5.0 depends on version 5.6 of the Illuminate packages. I can see you have Laravel 5.5 installed, so either upgrade Laravel to 5.6, or use the 4.0 branch of Passport.

The "require" section of composer.json in the Passport repository has it all specified:

"require": {
    "php": ">=7.0",
    "firebase/php-jwt": "~3.0|~4.0|~5.0",
    "guzzlehttp/guzzle": "~6.0",
    "illuminate/auth": "~5.6",
    "illuminate/console": "~5.6",
    "illuminate/container": "~5.6",
    "illuminate/contracts": "~5.6",
    "illuminate/database": "~5.6",
    "illuminate/encryption": "~5.6",
    "illuminate/http": "~5.6",
    "illuminate/support": "~5.6",
    "league/oauth2-server": "^6.0",
    "phpseclib/phpseclib": "^2.0",
    "symfony/psr-http-message-bridge": "~1.0",
    "zendframework/zend-diactoros": "~1.0"
},

The Illuminate version numbers line up with the frameworks, so Laravel 5.6 would use Illuminate 5.6, 5.5 would use Illuminate 5.5, etc.

See: Upgrade Guide - Upgrading To 5.6.0 From 5.5.

0
votes

I had the same issue I am using Laravel Framework 5.4

It got solved by using lower version of passport

composer require laravel/passport "4.0.3"