Package Data | |
---|---|
Maintainer Username: | hcomg |
Maintainer Contact: | hcomg.corp@gmail.com (HCOMG) |
Package Create Date: | 2017-05-17 |
Package Last Update: | 2017-08-23 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-06 03:08:04 |
Package Statistics | |
---|---|
Total Downloads: | 24 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
php artisan command to generate fully working crud with api resource by having database tables
1. Add api to routes.
2. Create resource controller with Dingo API.
3. Create model with Validator rules from Database.
4. ...
Laravel >=5.1
PHP >= 5.5.9
dingo/api: 1.0.x@dev
Open your terminal(CLI), go to the root directory of your Laravel project, then follow the following procedure.
Install Through Composer
composer require hcomg/laravel-easy-generator --dev
Add the Service Provider
Open /app/Providers/AppServiceProvider.php
and, to your register
function, add:
public function register()
{
if ($this->app->environment() !== 'production') {
$this->app->register(\EasyGenerator\EasyGeneratorServiceProvider::class);
}
}
Run php artisan help hcomg:gen
to see all parameters
##Examples
php artisan hcomg:gen --model=User --table=users --controller=User
Creating catalogue for table: users
Model Name: User
Created Controller: ./app/Models/User.php
Created Controller: ./app/Http/Controllers/UserController.php
Created Controller: ./app/Transformers/UserTransformer.php
Adding Route: $api->resource('users', '\App\Http\Controllers\UserController');
Then run php artisan api:routes
to see the api list.