Database metadata-based generators for Laravel 5
Laravel's built-in generators are great... but they'd be just perfect if they could fetch some database metadata to generate our models and controllers, right?! That's what this project aims to do - generate objects in a flexible way, allowing you to customize the generated code, defining your own templates and parameters.
You can simply use the commands defined in the project, create your own commands or even an application with GUI that uses Laravel5-Generators as a library to generate code. It's up to you.
Run the following command to install the package:
composer require gabrieloliverio/laravel5-generators --dev
php-cs-fixer, in order to beautify the generated code:
composer require friendsofphp/php-cs-fixer --dev
Once installed, open up
config/app.php file, find the
providers key and add
the following line to the bottom:
Publish the configuration file running the following command:
php artisan vendor:publish --tag=generators
This will copy the configuration file to
config/generators.php. You can
explore and change the default values, if you wish.
Now include the following lines inside the
$commands property, in the
The easiest way to use Laravel5-Generators is through its commands, to generate models and controllers.
php artisan make:bronco:model Path/To/Model
php artisan make:bronco:controller Path/To/Controller
The Laravel5-Generators is licensed under the MIT license.