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

laravel 5.5 package developing need to use composer require vendor_name/package_name

我开发了一个 Laravel 5.5 包自动发现包并将其推送到 git 集线器

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

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

提供

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

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

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