bluecode / laravel-generator
Laravel Generator
dev-master
2017-09-16 02:05 UTC
Requires
- php: >=5.5.9
- doctrine/dbal: ~2.6
- laravelcollective/html: 5.*
This package is not auto-updated.
Last update: 2024-12-21 18:50:11 UTC
README
This package extend make laravel command to use custom template. Further more, add some new command as generate mvc, create new package.
Documentation is in process...
Documentation
Installation
- Add this package to your composer.json:
composer require bluecode/laravel-generator
- Run composer update
composer update
- Add the ServiceProviders to the providers array in
config/app.php
Bluecode\Generator\GeneratorServiceProvider::class,
As we are using laravelcollective/htmlas a dependency
so we need to add those ServiceProviders as well.
Collective\Html\HtmlServiceProvider::class,
Also for convenience, add these facades in alias array in config/app.php
'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class,
Publish
- Publish configuration file
generator.php
php artisan vendor:publish --tag=laravel-generator.config
- Publish template folder into
resources/vendor/laravel-generator/templates
php artisan vendor:publish --tag=laravel-generator.template
Generator Command
- Generate Migration:
php artisan gen:migrate MigrationName
e.g.
php artisan gen:migrate create_posts_table
- Generate Model:
php artisan gen:model ModelName
e.g.
php artisan gen:model Post
- Generate Controller
php artisan gen:model ModelName
e.g.
php artisan gen:model Post
- Generate View
php artisan gen:view ViewName
e.g.
php artisan gen:view index php artisan gen:view create
- Generate MVC:
php artisan gen:mvc ModelName
e.g.
php artisan gen:mvc Post php artisan gen:mvc Post --actions=index,create,edit
- Generate Package
php artisan gen:package VendorName PackageName
e.g.
php artisan gen:package Module Post php artisan gen:package Module Post --path=packages/post php artisan gen:package Module Post --actions=index,create,edit
Option
Use --overwrite to overwrite exist file on all command.
Credits
This Laravel Generator is created by Bluecode.
Bugs & Forks are welcomed :)