PHP code example of hcomg / laravel-easy-generator
1. Go to this page and download the library: Download hcomg/laravel-easy-generator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hcomg / laravel-easy-generator example snippets
public function register()
{
if ($this->app->environment() !== 'production') {
$this->app->register(\EasyGenerator\EasyGeneratorServiceProvider::class);
}
}
bash
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');