Generate all Structure for a given resource name
Note: The code in this sample was originally written for a user experience prototype and does not necessarily demonstrate how to create production quality code.
Create and remove components of a resource. These include:
Resourceful Controller
Migration
Seeder
Create Form Request
Update From Request
Test
Transformer
Via Composer
$ composer require groch/resource-generator
Register the service provider in config/app.php
.
groch\ResourceGenerator\ResourceGeneratorServiceProvider::class,
Publish assets from the package.
php artisan vendor:publish --tag=install-resource
Add your UsersTableSeeder
and move the default "User.php" model to Model
namespace/folder.
php artisan migrate:fresh --seed
php artisan config:clear
php artisan config:cache
composer dump-autoload
php artisan key:generate
php artisan jwt:secret
Run php artisan
to see the new command gen:resource
.
Generate a new resource
php artisan gen:resource car
Remove a generated resource
php artisan gen:resource car --delete=1
Please see CHANGELOG for more information on what has changed recently.
- Thomas Letsch Groch
The MIT License (MIT). Please see License File for more information.