Using Infyom generator to streamline scaffolding with laravel at kozzaja


We have worked on many projects that required creating APIs and scaffold CRUD type of thing. And the problem that we faced every time was to create a bunch of files like Migration, Model, Controller, Repository and even test cases. So to streamline the process of scaffolding these operations: there is a special package in laravel community called Infyom Generator.

Infyom Generator is a laravel package which does the task of generating a bunch of files which are regularly used in laravel. It also allows us to to generate test cases, swagger annotations, auth scaffold, layouts and scaffold templates of your choice of CSS framework like bootstrap, materializecss, semantic-ui etc.

Prior to these generator, developer needed to continuously create a bunch of files every time they create a new class or route.

How to use Infyom generator ?

Step 1: Add following packages into your composer.json

"require": {
    "infyomlabs/laravel-generator": "5.3.x-dev",
    "laravelcollective/html": "^5.3.0",
    "infyomlabs/adminlte-templates": "5.3.x-dev"

Step 2:  Composer update
After adding packages, run the command below

$ composer update

Step 3:Add following service providers into your providers array in config/app.php



Step 4: Add following alias to aliases array in config/app.php

'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class, 
'Flash' => Laracasts\Flash\Flash::class,

Step 5: Run the command below

$ php artisan vendor:publish

Finally, you can you can use Infyom generator for generating laravel files.

Happy Coding

Full source here