Home > front end >  laravel/passport for laravel lumen support
laravel/passport for laravel lumen support

Time:02-28

Currently i'm using laravel lumen version 8 for API and i want to integrate laravel/passport for OAuth authorization for the API but when i try to install laravel/passport i get the following error and cannot install laravel/passport for the project. I tried installing dusterio/lumen library for laravel/passport but the package had also some issue with lumen 8.

Problem 1
    - lcobucci/jwt[3.3.0, ..., 3.4.x-dev] require php ^5.6 || ^7.0 -> your php version (8.0.14) does not satisfy that requirement.
    - lcobucci/jwt 4.0.0-alpha1 requires php ^7.1 -> your php version (8.0.14) does not satisfy that requirement.
    - lcobucci/jwt[4.0.0-alpha2, ..., 4.0.0-alpha3] require php ^7.2 -> your php version (8.0.14) does not satisfy that requirement.
    - Conclusion: don't install laravel/passport v10.3.2 (conflict analysis result)
    - Root composer.json requires tymon/jwt-auth dev-develop -> satisfiable by tymon/jwt-auth[dev-develop].
    - Root composer.json requires laravel/passport ^10.3 -> satisfiable by laravel/passport[v10.3.0, v10.3.1, v10.3.2, 10.x-dev].
    - tymon/jwt-auth dev-develop requires lcobucci/jwt <3.4 -> satisfiable by lcobucci/jwt[1.0.0, 1.0.1, 1.0.2, 1.1.0, 2.0.0, ..., 2.1.x-dev, 3.0.0, ..., 3.3.x-dev].
    - You can only install one version of a package, so only one of these can be installed: lcobucci/jwt[1.0.0, 1.0.1, 1.0.2, 1.1.0, 2.0.0, ..., 2.1.x-dev, 3.0.0, ..., 3.4.x-dev, 4.0.0-alpha1, ..., 4.2.x-dev].
    - laravel/passport 10.x-dev requires lcobucci/jwt ^3.4|^4.0 -> satisfiable by lcobucci/jwt[3.4.0, ..., 3.4.x-dev, 4.0.0-alpha1, ..., 4.2.x-dev].
    - Conclusion: don't install lcobucci/jwt 4.1.5 (conflict analysis result)

You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel/passport:*" to figure out if any version is installable, or "composer require laravel/passport:^2.1" if you know which you need.

Following is the composer.json of my project.

{
    "require": {
        "php": "^7.3|^8.0",
        "dingo/api": "^3.0.0",
        "doctrine/dbal": "^3.1",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0",
        "illuminate/notifications": "^8.49",
        "illuminate/redis": "^8.49",
        "intervention/image": "^2.6",
        "laravel-notification-channels/onesignal": "^2.3",
        "laravel/lumen-framework": "^8.0",
        "league/flysystem-aws-s3-v3": "^1.0",
        "maatwebsite/excel": "^3.1",
        "pusher/pusher-php-server": "^7.0",
        "simplesoftwareio/simple-qrcode": "^4.2",
        "spatie/data-transfer-object": "^3.7",
        "spatie/laravel-activitylog": "^4.4",
        "spatie/laravel-permission": "^4.0",
        "spatie/laravel-query-builder": "^3.4",
        "spatie/laravel-settings": "^2.1",
        "thiagoalessio/tesseract_ocr": "^2.12",
        "tymon/jwt-auth": "dev-develop",
        "williamcruzme/laravel-fcm": "^1.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "flipbox/lumen-generator": "^8.2",
        "knuckleswtf/scribe": "^3.21",
        "mockery/mockery": "^1.3.1",
        "phpunit/phpunit": "^9.3"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        },
        "files": [
            "app/helpers.php"
        ]
    },
    "autoload-dev": {
        "classmap": [
            "database/migrations",
            "tests/"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true,
        "allow-plugins": {
            "composer/package-versions-deprecated": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ]
    }
}

CodePudding user response:

Main problem is the tymon/jwt-auth removing this package and clean install fixed the problem.

  • Related