laravel 5.5包开发需要使用composer require vendor_name / package_name

时间:2017-12-25 09:00:35

标签: laravel github composer-php package packagist

我开发了一个带有自动发现包的Laravel 5.5软件包并将其推送到git hub

https://github.com/adamibrahim/authconfirm

我跑的时候

$ composer require "adamibrahim/authconfirm" : "v0.1.1"

我收到了错误

could not find package adamibrahim/authconfirm at any version for your min ...

我是否需要在某处注册我的存储库,以便我可以使用composer require命令?

这是我的包composer.json

{
"name": "adamibrahim/authconfirm",
"type": "library",
"description": ":Laravel 5.5 Auth modifications to confirm the auth email",
"keywords": [
    "Laravel5.5",
    "Auth",
],
"homepage": "https://github.com/adamibrahim/authconfirm",
"license": "MIT",
"authors": [
    {
        "name": ":Adam Ibrahim",
        "email": ":adamibrahim1701@gmail.com",
        "homepage": ":author_website",
        "role": "Developer"
    }
],
"require": {
    "illuminate/support": "~5.1",
    "php" : "~5.6|~7.0"
},
"require-dev": {
    "phpunit/phpunit" : ">=5.4.3",
    "squizlabs/php_codesniffer": "^2.3"
},
"autoload": {
    "psr-4": {
        "Adamibrahim\\Authconfirm\\": "src"
    }
},
"autoload-dev": {
    "psr-4": {
        "Adamibrahim\\Authconfirm\\": "tests"
    }
},
"extra": {
    "branch-alias": {
        "dev-master": "1.0-dev"
    }
},
"config": {
    "sort-packages": true
}
}

1 个答案:

答案 0 :(得分:3)

嗯,仅仅创建Github存储库以通过composer使用它是不够的。您应该在https://packagist.org/创建帐户并在其中添加您的包,以便通过composer require将其提供。

此外,您应该在Github上设置Packagist集成:

https://github.com/adamibrahim/authconfirm/settings/installations

确保在Github Packagist发生更改后会看到这些更改。