laravel9
https://packagist.org/packages/spatie/laravel-package-tools
composer require spatie/laravel-package-tools
laravel6
naoray/laravel-package-maker
GitHub地址:https://github.com/naoray/laravel-package-maker
"naoray/laravel-package-maker": "v3.1.0"
执行 php artisan make:package
What's your packages name?:
> implogs
What's the packages github name (vendor name of the package)?:
> shuxiaoyuan666
Where should the package be installed?:
> packages/
Who is the author of the package?:
> xiaoyuan.shu
What's the mantainer's e-mail?:
> sxy@shuxiaoyuan.com
Who will hold the copyrights?:
> xiaoyuan.shu
+-----------------+----------------+-----------+--------------+---------------------+--------------+
| Name | Vendor | Directory | Author | E-mail | Copyright |
+-----------------+----------------+-----------+--------------+---------------------+--------------+
| implogs | shuxiaoyuan666 | packages/ | xiaoyuan.shu | sxy@shuxiaoyuan.com | xiaoyuan.shu |
+-----------------+----------------+-----------+--------------+---------------------+--------------+
Do you wish to continue? (yes/no) [no]:
> yes
readme created successfully.
license created successfully.
contribution created successfully.
phpunit created successfully.
gitignore created successfully.
composer created successfully.
Provider created successfully.
Testbase created successfully.
What CI/CD service you want to configure? [None]:
[0] None
[1] TravisCI
> 0
What Code Quality service you want to configure? [None]:
[0] None
[1] StyleCI
> 1
styleci created successfully.
What Code Coverage service you want to configure? [None]:
[0] None
[1] Codecov
> 0
Package successfully created!
然后就是编写代码,提交代码到GitHub,打tag,打Releases,然后去 https://packagist.org/packages
网站发布或更新 composer 包
本地项目引入 composer 包,执行 php artisan vendor:publish
选择相应的序号,发布配置文件