laravel 5.5 包开发需要使用 composer require vendor_name/package_name
Posted
技术标签:
【中文标题】laravel 5.5 包开发需要使用 composer require vendor_name/package_name【英文标题】:laravel 5.5 package developing need to use composer require vendor_name/package_name 【发布时间】:2018-06-06 14:56:20 【问题描述】:我开发了一个 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】:好吧,仅仅创建 Github 存储库以通过 composer 使用它是不够的。您应该在https://packagist.org/ 创建帐户并将您的包添加到那里,以便通过composer require
提供。
此外,您应该在 Github 上设置 Packagist 集成:
https://github.com/adamibrahim/authconfirm/settings/installations
确保在 Github Packagist 中的更改后会看到这些更改。
【讨论】:
感谢您的回复将检查,并试一试 当然,当你准备好发布到 packagist 时你会这样做。在此之前,您可以直接从 Github 或其他一些存储库中使用 composer 进行安装。可以在此处找到有关如何执行此操作的详细信息:getcomposer.org/doc/05-repositories.md#vcs以上是关于laravel 5.5 包开发需要使用 composer require vendor_name/package_name的主要内容,如果未能解决你的问题,请参考以下文章
Laravel 教程 - Web 开发实战入门 ( Laravel 5.5 )购买链接