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

问题描述 投票:1回答:1

我开发了一个包含自动发现的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": ":[email protected]",
        "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
}
}
laravel github composer-php package packagist
1个回答
3
投票

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

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

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

确保在Github Packagist发生变化后会看到这些变化。

© www.soinside.com 2019 - 2024. All rights reserved.