2017 © Pedro Peláez
 

crud laravel-crud

Package to create controller, models, migrations, requests and views

image

developernaren/laravel-crud

Package to create controller, models, migrations, requests and views

  • Tuesday, December 15, 2015
  • by developernaren
  • Repository
  • 4 Watchers
  • 4 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

laravel-crud

Crud Operations for Laravel, (*1)

$ composer require developernaren/laravel-crud

Note: This pacakage is still not a stable package, hence not suitable for production., (*2)

DeveloperNaren\Crud\Providers\CrudServiceProvider::class

add this line to the service providers list in app.config.php and that's it., (*3)

$ php artisan vendor:publish

To copy the config file to your config directory, (*4)

I am making this package highly customizable. A lof of options in this package can be customized through the config file., (*5)

$ php artisan crud:whole

This command asks two questions - What entity are you trying to create crud for? The answer should be the entity name. Eg: category - Fields string in format : separated by comma(,) Field and Type separated by comma. Eg: name:str,description:text, (*6)

This command generates controller, model, request, create view, list view, migration files., (*7)

If you do not have to generate all the files, You can generate things individually, (*8)

$ php artisan crud:controller <entity>

This generates controller for the given entity, (*9)

$ php artisan crud:model <entity> <field string>

This generats model for the given entity with fillable, (*10)

We can also generate relations this package. The supplied format to support realtions, (*11)

<field>:fr-<foreigntable>.<foreign field> for not null foreign keys, (*12)

<field>:nlfr-<foreigntable>.<foreign field> for nullable foreign keys, (*13)

The foreign keys are made generic to support migration and relation., (*14)

$ php artisan crud:model blog name:str,author_id:nlfr-users.id, (*15)

This command will generate a method, (*16)

function user() { $this->belongsTo( 'User' ); }, (*17)

in Blog.php, (*18)

Meaning a blog belongs to a user, (*19)

$ php artisan crud:view <entity> <field string>

This generates create.blade.php and list.blade.php for the given entity with the fields, (*20)

This module can now generate input, textarea, select, radio, checkbox based on the fields provided, (*21)

$ php artisan crud:request <entity> <field string>

This generates FormRequest class for the add form, (*22)

$ php artisan request:migration <entity> <field string>

This generates migration for the given entity with the mentioned fields, (*23)

We can also generate foreign keys through this package. The supplied format to support foreign keys should be, (*24)

<field>:fr-<foreigntable>.<foreign field> for not null foreign keys, (*25)

<field>:nlfr-<foreigntable>.<foreign field> for nullable foreign keys, (*26)

We can also provide path for the migration to be created at in config file., (*27)

Todos:, (*28)

  • Make the template dynamic
  • List the replacable template variables so that user can create custom templates for the generated files
  • Support foreign leys for migrations

The Versions

15/12 2015

dev-master

9999999-dev

Package to create controller, models, migrations, requests and views

  Sources   Download

MIT

The Requires

 

by Naren

21/11 2015

dev-dev

dev-dev

Package to create controller, models, migrations, requests and views

  Sources   Download

MIT

The Requires

 

by Naren