簡體   English   中英

在laravel中使用composer安裝Mailgun \\ Bogardo包

[英]Issue installing Mailgun\Bogardo package with composer in laravel

我目前正在嘗試使用以下命令安裝Bogardo \\ Mailgun composer包:

composer require bogardo/mailgun

但是在運行命令之后,依賴關系存在問題,我不知道如何解決這個問題,因為我對作曲家沒有多少經驗。 使用npm我有npm審計修復命令,它負責修復任何沖突,但我怎么能在這里修復m問題?

這是我的命令提示符顯示的內容:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install bogardo/mailgun v5.0.4
    - Conclusion: don't install bogardo/mailgun v5.0.3
    - Conclusion: don't install bogardo/mailgun v5.0.2
    - Conclusion: don't install bogardo/mailgun v5.0.1
    - Conclusion: remove nesbot/carbon 2.17.0
    - Installation request for bogardo/mailgun ^5.0 -> satisfiable by bogardo/mailgun[v5.0.0, v5.0.1, v5.0.2, v5.0.3, v5.0.4].
    - Conclusion: don't install nesbot/carbon 2.17.0
    - bogardo/mailgun v5.0.0 requires nesbot/carbon ^1.21 -> satisfiable by nesbot/carbon[1.21.0, 1.22.0, 1.22.1, 1.23.0, 1.24.0, 1.24.1, 1.24.2, 1.25.0, 1.26.0, 1.26.1, 1.26.2, 1.26.3, 1.26.4, 1.27.0, 1.28.0, 1.29.0, 1.29.1, 1.29.2, 1.30.0, 1.31.0, 1.31.1, 1.32.0, 1.33.0, 1.34.0, 1.34.1, 1.34.2, 1.34.3, 1.34.4, 1.35.0, 1.35.1, 1.36.0, 1.36.1, 1.36.2].
    - Can only install one of: nesbot/carbon[1.26.3, 2.17.0].
    - Can only install one of: nesbot/carbon[1.26.4, 2.17.0].
    - Can only install one of: nesbot/carbon[1.27.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.28.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.29.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.29.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.29.2, 2.17.0].
    - Can only install one of: nesbot/carbon[1.30.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.31.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.31.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.32.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.33.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.34.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.34.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.34.2, 2.17.0].
    - Can only install one of: nesbot/carbon[1.34.3, 2.17.0].
    - Can only install one of: nesbot/carbon[1.34.4, 2.17.0].
    - Can only install one of: nesbot/carbon[1.35.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.35.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.36.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.36.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.36.2, 2.17.0].
    - Can only install one of: nesbot/carbon[1.21.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.22.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.22.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.23.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.24.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.24.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.24.2, 2.17.0].
    - Can only install one of: nesbot/carbon[1.25.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.26.0, 2.17.0].
    - Can only install one of: nesbot/carbon[1.26.1, 2.17.0].
    - Can only install one of: nesbot/carbon[1.26.2, 2.17.0].
    - Installation request for nesbot/carbon (locked at 2.17.0) -> satisfiable by nesbot/carbon[2.17.0].


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

我的composer.json文件:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "intervention/image": "^2.4",
        "kriswallsmith/buzz": "^1.0",
        "laravel/framework": "5.8.*",
        "laravel/tinker": "^1.0",
        "mailgun/mailgun-php": "^2.8",
        "nyholm/psr7": "^1.1"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0",
        "stripe/stripe-php": "^6.29"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        },
        "files": ["App/Helpers/Strings.php"]
    },
    "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 --ansi"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

因為Laravel需要Carbon 2.x你的(過時的)軟件包需要Carbon 1.x,所以存在沖突。 最簡單的解決方案是使用另一個類似官方的郵件包: https//github.com/mailgun/mailgun-php

編輯: Laravel甚至不需要額外的包,開箱即可支持Mailgun!

編輯2: Laravel也可以使用1.x版本,但選擇不使用。 說實話,我不知道如何強迫Laravel使用舊版本

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM