backtheweb / laravel-package-maker
A Laravel package to create new packages with a simple command
0.1.0
2023-05-11 10:48 UTC
Requires
- php: ^8.0
Requires (Dev)
- orchestra/testbench: ^8.0
- phpunit/phpunit: ^10.1
README
Laravel PackageMaker
Installation
Install the package via composer:
$ composer require backtheweb/laravel-package-maker --dev
Publish the config file and edit it to your needs
$ php artisan vendor:publish --provider="Backtheweb\PackageMaker\PackageMakerServiceProvider" --tag="config"
Create a new folder called modules
(or wherever you want, don't forget update the config file)
in the root of your Laravel project and add the following to your composer.json file:
"repositories": [
{
"type": "path",
"url": "modules/*/**",
"options": {
"symlink": false
}
]
$ php artisan make:package vendor/package
The command will create the following structure and files:
- packageName
- config
- packageName.php
- src
- PackageNameServiceProvider.php
- tests
- Feature
- Unit
- TestCase.php
- .gitignore
- CHANGELOG.md
- composer.json
- LICENSE
- phpunit.xml
- README.md
- config
USer --force
option to overwrite existing files
$ php artisan make:package yourPackageName --force
How Laravel package development
https://laravelpackage.com/#reasons-to-develop-a-package