phpviet / laravel-omnipay

:dizzy: Package hổ trợ tích hợp các cổng thanh toán trong nước.
MIT License
91 stars 50 forks source link

Lỗi khi cài trên Laravel 8 #13

Closed congnv0330 closed 3 years ago

congnv0330 commented 3 years ago

Hiện là mình khi cài trên laravel 8 thì bị lỗi như thế này Hình như là bị conflic với version guzzlehttp/guzzle mặc định trên laravel 8 Mình có xem trên trên upgrade guide laravel 8 thì thấy yêu cầu update guzzle lên ^7.0.1, còn bên laravel-omnipay thì hình như yêu cầu 6.5

Using version ^1.1 for phpviet/laravel-omnipay
./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 phpviet/laravel-omnipay ^1.1 -> satisfiable by phpviet/laravel-omnipay[1.1.0, 1.1.1, 1.1.x-dev].
    - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.2.0].
    - Can only install one of: guzzlehttp/guzzle[7.2.0, 6.5.x-dev].
    - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.2.0].
    - Conclusion: install guzzlehttp/guzzle 6.5.x-dev
    - Installation request for guzzlehttp/guzzle (locked at 7.2.0, required as ^7.0.1) -> satisfiable by guzzlehttp/guzzle[7.2.0].

Installation failed, reverting ./composer.json to its original content.
vuongxuongminh commented 3 years ago

Bạn có thể show composer.json của bạn được không?

congnv0330 commented 3 years ago

Bạn xem giúp mình

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.3",
        "ckfinder/ckfinder-laravel-package": "v3.5.1.6",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.0",
        "laravel/tinker": "^2.0",
        "laravel/ui": "^3.0",
        "spatie/laravel-permission": "^3.17",
        "yajra/laravel-datatables-oracle": "^9.11"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.5",
        "facade/ignition": "^2.3.6",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "files": [
            "app/Fpo/helper.php"
        ],
        "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"
        ]
    }
}
vuongxuongminh commented 3 years ago

Bạn chạy composer update guzzlehttp/guzzle, sau đó thử lại nha.

On Sun, 22 Nov 2020 at 16:36 Nguyễn Văn Công notifications@github.com wrote:

Bạn xem giúp mình

{

"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",

    "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"

    ]

}

}

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/phpviet/laravel-omnipay/issues/13#issuecomment-731721645, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJJBBERT4SBS3HA5XJ3SINDSRDLSPANCNFSM4T5Q6MWA .

-- Vương Minh

congnv0330 commented 3 years ago

Hiện là mình có thử theo hướng dẫn bạn rồi mà nó vẫn bị lỗi như trên. Mình có thử tạo mới một project laravel 8 rồi cài vẫn lỗi đó á bạn. Còn từ laravel 7 trở xuống mình cài bình thường.

vuongxuongminh commented 3 years ago

Cảm ơn bạn đã thử, bạn hãy thử cài lại bằng cách:

composer req php-http/guzzle7-adapter phpviet/laravel-omnipay

Lý do như bạn nói từ Laravel 8 default Guzzle 7 được sử dụng nhưng mặc định omnipay đang sử dụng Guzzle 6 nên bị conflict.

congnv0330 commented 3 years ago

Tuyệt vời, cám ơn bạn nha. Bạn có thể update lại doc để có thể trách được vài người hỏi lại giống mình 👍