groch / resource-generator
Generate all Structure for a given resource name.
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
- laravel/framework: ~5.4
- league/fractal: ^0.16.0
- tymon/jwt-auth: dev-develop
Requires (Dev)
- phpunit/phpunit: ~7.0
- squizlabs/php_codesniffer: ^2.3
README
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.