matmaxanh / laravel-generator by bluecode

Laravel Generator
469
16
7
Package Data
Maintainer Username: bluecode
Package Create Date: 2015-11-19
Package Last Update: 2017-09-16
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-12-15 15:10:07
Package Statistics
Total Downloads: 469
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 16
Total Watchers: 7
Total Forks: 7
Total Open Issues: 0

Laravel Resource Generator (Laravel5.4)

Codacy Badge Latest Stable Version Total Downloads Latest Unstable Version License

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

  1. Installation
  2. Publish
  3. Generator Command
  4. Option

Installation

  1. Add this package to your composer.json:
composer require bluecode/laravel-generator
  1. Run composer update
composer update
  1. 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

  1. Publish configuration file generator.php
php artisan vendor:publish --tag=laravel-generator.config
  1. Publish template folder into resources/vendor/laravel-generator/templates
php artisan vendor:publish --tag=laravel-generator.template

Generator Command

  1. Generate Migration:
php artisan gen:migrate MigrationName

e.g.

php artisan gen:migrate create_posts_table
  1. Generate Model:

php artisan gen:model ModelName

e.g.

php artisan gen:model Post
  1. Generate Controller
php artisan gen:model ModelName

e.g.

php artisan gen:model Post
  1. Generate View
php artisan gen:view ViewName

e.g.

php artisan gen:view index
php artisan gen:view create
  1. Generate MVC:
php artisan gen:mvc ModelName

e.g.

php artisan gen:mvc Post
php artisan gen:mvc Post --actions=index,create,edit
  1. 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 :)