Package manager for sebastienheyd/boilerplate.
This package will allow you to easily create and manage your own local packages for sebastienheyd/boilerplate.
Via Composer
composer require sebastienheyd/boilerplate-packager --dev
Optionnal: publish configuration file
php artisan vendor:publish --tag=boilerplate-packager
By default, a help is displayed when calling boilerplate:packager
without any argument.
php artisan boilerplate:packager
By default, every package will be generated using sebastienheyd/boilerplate-package-skeleton.
Note that you can use a local path instead by setting the skeleton
value in the configuration file.
You can also modify the default creation data (author, e-mail, description, license) by modifying the values in the configuration file
php artisan boilerplate:packager create my-vendor/my-package
In this example, after asking some questions about author, email, description, license and resource, the command will load the skeleton package in a packages/my-vendor/my-package
directory.
Then, it will require the local package in your project, a symlink is created in the vendor
directory pointing to the local package.
All you have to do after that is to code in you freshly installed package.
Options
You can create a package with the option --dev
to add the package to the require-dev
section in composer.json
You can require a package from packagist or by giving a git repository url.
php artisan boilerplate:packager require my-vendor/my-package
php artisan boilerplate:packager require https://github.com/my-vendor/my-package
php artisan boilerplate:packager require git@github.com/my-vendor/my-package
This will clone the package in the packages
folder and require it via composer.
Options
You can require a package with the option --dev
to add the package to the require-dev
section in composer.json
You can remove a local package by using the remove
command.
If you called the command without a package name you will be asked to chose the package to remove :
php artisan boilerplate:packager remove
php artisan boilerplate:packager remove my-vendor/my-package
This will remove the local package from your project. The command will ask to confirm the deletion of the local folder.
php artisan boilerplate:packager list
This will display a table with all local packages, installed or not.
This command will generate templates, controllers, views, menus, translations for the tables generated by the package.
To do this, after creating your package with the create
command, create the migrations in the package and then run them
to generate the tables in the database. After that, run the crud
command indicating the package in which the
migrations are located.
php artisan boilerplate:packager crud my-vendor/my-package
It is possible that the foreign keys point to a model that is not in the package. The command will then ask you to enter the namespace related to the model needed for the relationship.
Be careful, if files already exist in the package they will be overwritten.
You can generate specified resources by using the option --only
and one or many of the following keywords : model
, routes
, lang
, permissions
, controller
, menu
, views
php artisan boilerplate:packager crud my-vendor/my-package --only=views --only=routes
Sometimes your package will use prefixed tables, to avoid generating files with the prefix you can remove it by using the option --prefix
php artisan boilerplate:packager crud my-vendor/my-package --prefix=myprefix__
This package is delivered with tests, to launch tests just launch:
make test
Coding standard can also be checked by using phpcs
:
make cs
Please see contributing.md for details.
If you discover any security related issues, please email author email instead of using the issue tracker.
MIT license. Please see the license file for more information.