Generator GUI Interface Beta
Generator GUI Builder is currently in Beta and its not in a sync with current laravel-generator package. We highly recommend to use command line interface.
Generator also comes with visual GUI interface builder which can be used to generate code from GUI interface. Its add-on extension which can be installed optionally.
With this interface, you can specify the fields you want in your models and with all options of swagger, test cases, soft delete etc. and then generates the exact same files which are generated from the command line.
Also, You can put builder on your choice of route and with middleware, so your application can be secure.
Installation
Add Package
Add following packages into your composer.json
.
"require": {
"infyomlabs/generator-builder": "dev-master"
}
Composer Update
After adding packages, run the following command:
composer update
Add Service Provider
Add following service providers into your providers array in config/app.php
\InfyOm\GeneratorBuilder\GeneratorBuilderServiceProvider::class,
Run Publish Command
Run publish command for builder to generate config file,
php artisan vendor:publish
It will create config/infyom/generator_builder.php
in which views for the generator is
specified.
Run routes Publish Command
Run publish command for builder to generate config file,
php artisan infyom.publish:generator-builder
It will publish following routes in routes.php
.
Route::get('generator_builder', '\InfyOm\GeneratorBuilder\Controllers\[email protected]');
Route::get('field_template', '\InfyOm\GeneratorBuilder\Controllers\[email protected]');
Route::post('generator_builder/generate', '\InfyOm\GeneratorBuilder\Controllers\[email protected]');
You can customize it your own way and put it in secure middleware as well with whatever permission level you want. Generator Builder will be opened on this routes.
Open generator_builder
url on your server or whatever customized routes you have placed.
Customization
You can also customize the view of generator builder and apply your theme and layout.
BUT MAKE SURE YOU DON'T MODIFY OR REMOVE ANY JS FILE OR FIELD, OTHERWISE BUILDER WILL NOT WORK PROPERLY.
To do that, run a publish command with views option,
php artisan infyom.publish:generator-builder --views
It will publish views in resources/views/infyom/generator-builder/
directory.
After that, change config file config/infyom/generator_builder.php
.
There are two views which are used in builder,
Main builder view,
change 'builder' => 'generator-builder::builder'
to 'builder' =>
'infyom.generator-builder.builder'
Field Template view,
change 'field-template' => 'generator-builder::field-template'
to 'field-template' =>
'infyom.generator-builder.field-template'