Generator GUI Interface

  1. Installation
    1. Add Package
    2. Run Composer Update
    3. Add Service Provider
    4. Run Publish Command
    5. Run routes Publish Command
  2. Customization

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

Note: Make sure, you have InfyOm Laravel Generator already installed before you proceed with this installation. If not then first go for it. You can find installation steps here.

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'

Made with Generator Hire Us