dev-master
9999999-devPackage to create controller, models, migrations, requests and views
MIT
The Requires
by Naren
dev-dev
dev-devPackage to create controller, models, migrations, requests and views
MIT
The Requires
by Naren
Package to create controller, models, migrations, requests and views
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
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)
Package to create controller, models, migrations, requests and views
MIT
Package to create controller, models, migrations, requests and views
MIT