groch/resource-generator

Generate all Structure for a given resource name.

1.1.0 2020-03-28 19:01 UTC

This package is auto-updated.

Last update: 2024-04-29 03:38:26 UTC


README

Latest Version on Packagist Software License

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.

Structure

Create and remove components of a resource. These include:

Resourceful Controller
Migration
Seeder
Create Form Request
Update From Request
Test
Transformer

Install

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

Usage

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

Change log

Please see CHANGELOG for more information on what has changed recently.

Credits

  • Thomas Letsch Groch

License

The MIT License (MIT). Please see License File for more information.