Adds Artisan command generators for the package for Commands, Migrations, Controllers, Models for rapid package development.
This package comes with useful generators:
php artisan package:create
php artisan package:command
php artisan package:controller
php artisan package:migration
php artisan package:model
Via Composer
$ composer require se468/laravel-package-generators-extended
If you do not want to type vendor/package/namespace over and over for your generators, we offer a config file method.
Publish the config file.
$ php artisan vendor:publish
It will generate package-generators.php
in the app/config
directory. You can modify vendor
, package
, namespace
to set the default package. You may now call the commands without specifying vendor/package/namespaces, and just specify the name of the file you want to create.
$ package:create {vendor} {package} {namespace}
Will create a service provider and composer.json
in your package src directory.
It will also add the psr4 namespaces in your laravel's composer.json
file and register the service provider in config/app.php
automatically.
It's that simple!
$ package:command {name_of_file} {vendor?} {package?} {namespace?} --path
Example:
$ php artisan package:command TestCommand se468 test-package TestNamespace
or using config file
$ php artisan package:command TestCommand
$ package:controller {name_of_file} {vendor?} {package?} {namespace?} --path
Example:
$ php artisan package:controller TestController se468 test-package TestNamespace
or using config file
$ php artisan package:controller TestController
$ package:migration {name_of_file} {vendor?} {package?} {namespace?} --path
Example:
$ php artisan package:migration create_test_migration se468 test-package TestNamespace
or using config file
$ php artisan package:migration create_test_migration
$ package:model {vendor} {package} {namespace} {name} --path
Example:
$ php artisan package:model TestModel se468 test-package TestNamespace
or using config file
$ php artisan package:model TestModel
The MIT License (MIT). Please see License File for more information.