Downloads
Stars
Version
composer require atnic/laravel-generator
This package is overriding some laravel artisan command.
This is example to make Foo module in this project
php artisan make:controller --model=Foo FooController
If create custom directory for model like this:
php artisan make:controller --model=App\\Models\\Foo FooController
Then do this steps:
database/migrations/
, add column needed.database/factories/
, add atrribute needed.app/
, add changes needed.app/Filters/
, do all TODO:
and remove the comment if done.resources/lang/en
and copy from en to lang id resources/lang/id
, add language as needed.app/Http/Controllers/
, complete returned array in method relations()
visibles()
fields()
rules()
, do all TODO:
, and remove comment if done.app/Policies/
, do all TODO:
and remove the comment if done.$policies
attribute in app/Providers/AuthServiceProvider.php
. This package handle policy auto discovery, even for Laravel < 5.8.resources/views/
, add/extend section for title or anything.tests/Feature/
, do all TODO:
and remove the comment if done.#Creating Nested Controller
php artisan make:controller --parent=Foo --model=Bar Foo/BarController
#Creating Nested Controller with custom directory for model
php artisan make:controller --parent=App\\Models\\Foo --model=App\\Models\\Bar Foo/BarController
#Create Single Action Controller
php artisan make:controller DashboardController
#Creating Api Controller
php artisan make:controller-api --model=Foo FooController
#Creating Api Controller with custom directory for model
php artisan make:controller-api --model=App\\Models\\Foo FooController
#Creating Nested Controller API
php artisan make:controller-api --parent=Foo --model=Bar Foo/BarController
#Creating Nested Controller API with custom directory for model
php artisan make:controller-api --parent=App\\Models\\Foo --model=App\\Models\\Bar Foo/BarController
All new/overrided command can be viewed in vendor/atnic/laravel-generator/app/Console/Commands
.