InfyOm Laravel Generator - API, Scaffold, Tests, CRUD Laravel Generator

Overview

InfyOm

InfyOm Laravel Generator

Total Downloads Monthly Downloads Daily Downloads License

Generate Admin Panels CRUDs and APIs in Minutes with tons of other features and customizations with 3 different themes.
Read Documentation for detailed installation steps and usage.

Support Us

We have created 14+ Laravel packages and invested a lot of resources into creating these all packages and maintaining them.

You can support us by either sponsoring us or buying one of our paid products. Or help us by spreading the word about us on social platforms via tweets and posts.

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site.

Backers

Become a backer and get your image on our README on Github with a link to your site.

Buy our Paid Products

InfyChat

You can also check out our other paid products on CodeCanyon.

Follow Us

Made with InfyOm Generator

Also, Do not forget to add your website to Made with InfyOm Generator List list.

Video Tutorials

Checkout Video Tutorials - By: Shailesh Ladumor

Comments
  • New mode: VueJS!

    New mode: VueJS!

    Hi friends, i'm working in crud with vuejs, using vue-table, vue-strap for use modal, vue-validator and vue-editable (very simple component. Is better modify for best features).

    Features:

    I like any docs for add this to generator, i can overwrite templates, but doesn't the better option. I like pass --vuejs or --vue option for generate crud with this.

    New files:

    • crud.js
    • model-config.js (this file is a file for each index -model- page, for config)
    • modal folder with modal template files for each model. Folder and files
    • Overwrite ApiRequest or create new extend from them, with this code:
        public function response(array $errors)
        {
            return Response::json(static::makeError($errors), 400);
        }
    
        /**
         * @param string $errors
         * @param array  $data
         *
         * @return array
         */
        public static function makeError($errors, array $data = [])
        {
            $res = [
                'success' => false,
                'errors' => $errors,
            ];
    
            if (!empty($data)) {
                $res['data'] = $data;
            }
    
            return $res;
        } 
    
    • index action in ApiController for each model:
    public function index(Request $request)
        {
    
            // handle sort option
            if (request()->has('sort')) {
                list($sortCol, $sortDir) = explode('|', request()->sort);
                $query = Provider::orderBy($sortCol, $sortDir);
            } else {
                $query = Provider::orderBy('name', 'asc');
            }
    
            if ($request->exists('filter')) {
                $query->where(function($q) use($request) {
                    $value = "%{$request->filter}%";
                    $q->where('name', 'like', $value)
                        ->orWhere('email', 'like', $value)
                        ->orWhere('code', 'like', $value);
                });
            }
    
            $perPage = request()->has('per_page') ? (int) request()->per_page : null;
            return response()->json($query->paginate($perPage));
        }
    
    feature no-longer-valid 
    opened by NightZpy 30
  • Unique fields

    Unique fields

    The scaffold generator does not allow a model to be updated if it contains a unique field.

    For example field a is unique, field b is not. If i update field b it will not save.

    under-review completed 
    opened by showFocus 19
  • Can be assign relations? Or new feature?

    Can be assign relations? Or new feature?

    Would be good relations can be assigned by command or json!

    Maybe:

    php artisan infyom:scaffold Post --relations="hasMany(Comment), belongsTo(User)"

    Or

    php artisan infyom:scaffold Post --hasMany=Comment --belongsTo=User

    feature completed 
    opened by NightZpy 16
  • scaffold and Class 'App\Http\Controllers\AppBaseController' not found`

    scaffold and Class 'App\Http\Controllers\AppBaseController' not found`

    I'm new to laravel-generator. I created a simple project following the documentation instructions. This is my project setup with dependencies versions.

    "require": { "php": ">=7.1.3", "fideloper/proxy": "~4.0", "infyomlabs/adminlte-templates": "5.6.x-dev", "infyomlabs/laravel-generator": "5.6.x-dev", "laravel/framework": "5.6.*", "laravel/tinker": "~1.0", "laravelcollective/html": "5.6.0" },

    After running scaffold for a simple model I keep receiving AppBaseController' not found in the generated controller.

    These are the steps to reproduce.

    php artisan infyom:scaffold Project --fieldsFile=fields_projects.json php artisan migrate

    fields_projects.json looks like this.

    [
        {
            "name": "id",
            "dbType": "increments",
            "htmlType": "",
            "validations": "",
            "searchable": false,
            "fillable": false,
            "primary": true,
            "inForm": false,
            "inIndex": false
        },
        {
            "name": "title",
            "dbType": "string",
            "htmlType": "text",
            "validations": "required",
            "searchable": true
        },
        {
            "name": "body",
            "dbType": "text",
            "htmlType": "textarea"
        }
    ]
    

    serve the app php artisan serve

    go to http://127.0.0.1:8000/projects

    get this error:

    Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN) Class 'App\Http\Controllers\AppBaseController' not found

    I've checked previous related issues here in the repository and tried different suggestions, but none could fix it. It seems I m missing something obvious here. Maybe others might be facing the same issue.

    help-needed under-review 
    opened by arianpasquali 14
  • model swagger error after publish template to resource

    model swagger error after publish template to resource

    I am trying to generate model swagger docs, and I found that final model file has error . then I figure out that $template = get_template('model.model', 'swagger-generator'); will get the model.model from the /resources/infyom/infyom-generator-templates/model/model.stub
    and I think this is big error

    completed 
    opened by LarryZhang 14
  • New feature: Datatables option

    New feature: Datatables option

    Hello bro, maybe add option for implement datatable javascript plugin for index page. For laravel exists some packages for this job. This is one: https://github.com/yajra/laravel-datatables.

    Greets.

    feature 
    opened by NightZpy 14
  • [L7] Datatables is not showing for the table

    [L7] Datatables is not showing for the table

    Hello, I want to list my records with datatables. step 1: add_on.datatabled = true step 2: executed the command php artisan infyom:api_scaffold Product

    But when I checked in the admin panel after adding a product it is not showing data with datatables.

    Am I missing something?

    Regards, Saneesh

    supported 
    opened by Saneesh 12
  • Many Issues

    Many Issues

    Firstly thank you so much for your wonderful software.

    I'm having a lot of problems when attempting to generate scaffolding for anything that contains any type of field other than plain strings or numbers. I've tried all kinds of versions, both the boilerplates and installing into a fresh Laravel 5.2 install as per the instructions on your website.

    Are date and boolean field types supposed to be working at this point in time, because they really are not.

    For example, when creating a scaffold for a model that includes a date, the scaffolding is created, and allows me to create a record which includes a date. This record is then correctly displayed in the index, but when I attempt to edit this record, the existing date information is not placed into the date field. It just shows "dd/mm/yyyy" again.

    If I include a boolean field with a checkbox, there is no display of that field in the index, and when editing the record, the box is show, but it's always checked, no matter what the existing record is. If I save the record with the box unchecked, then I can see by looking at the database directly that the record is not changed.

    I'd appreciate knowing if these are know issues, so that I can stop trying to solve problems that I'm not creating.

    Thank you so much for your help.

    under-review duplicate 
    opened by baylf2000 12
  • Scaffolding to use data from other tables

    Scaffolding to use data from other tables

    This is probably an extremely stupid question, but I'm still kinda new at this so go easy on me.

    Let's say I have two tables "Productions" and "Tours" with the corresponding models and relationships all working fine and correct. The Productions table has 2 columns: ID and Title. The Tours table has a column called "production_id" which references the ID column in the Productions table, and it has its own ID as well as its own Title column.

    The relationships go: a production has many tours and a tour has one production. I've used the php artisan infyom:scaffold $MODEL_NAME --fromTable --tableName=$TABLE_NAME commands to create the necessary repositories, etc.

    When I go to the "tours/create" admin page, how would I get it to populate the "Production" field so that while it would show the title of the production on the web interface, in the background it's using the production's ID number and will let me save the new Tour?

    completed 
    opened by nexxai 11
  • 'There isn not input fields to generate' when less than 3 fields in the fieldsFile

    'There isn not input fields to generate' when less than 3 fields in the fieldsFile

    Hi, I am using the CLI generator fieldsFile method. When I have less than 3 fields in the file, the artisan command give me 'There isn not input fields to generate.'

    Hereby I attach my fieldsFile content.

    [
        {
            "name": "id",
            "dbType": "increments",
            "htmlType": "",
            "validations": "",
            "searchable": false,
            "fillable": false,
            "primary": true,
            "inForm": false,
            "inIndex": false
        },
        {
            "name": "origin",
            "dbType": "string",
            "htmlType": "text",
            "validations": "required:unique",
            "searchable": true,
            "fillable": true,
            "primary": false,
            "inForm": true,
            "inIndex": false
        },
        {
            "name": "sequence",
            "dbType": "integer:unsigned",
            "htmlType": "select",
            "searchable": false,
            "fillable": true,
            "primary": false,
            "inForm": true,
            "inIndex": false
        }
    ]
    
    opened by zcythe 11
  • API Version defined in configuration is not being used

    API Version defined in configuration is not being used

    Hello

    I just setup laravel-generator with api_prefix = 'api' and api_version = 'v1'. But when I run php artisan infyom:api_scaffold Test the TestAPIController is placed directly in app/Http/Controllers/API/ without separate namespace for each version, and also the route registed by the package is not has v1 prefix too.

    I this normal or it's has something to do with my configuration?

    Thank you

    help-needed 
    opened by ton212 11
  • [Feature] Call seeder in DatabaseSeeder.php

    [Feature] Call seeder in DatabaseSeeder.php

    When database_seeder option is set to true in config/laravel_generator.php, the seeder for model gets generated, but not called in database/seeders/DatabaseSeeder.php, which is expected.

    Suggestion

    After generating seeder, add a call to the seeder inside this->call([])' in DatabaseSeeder.php file. Create the call function if it does not exist already.

    opened by Mosaab-Emam 0
  • [BUG] 3 errors in model file generation

    [BUG] 3 errors in model file generation

    Looking at what gets generated in the Model file, I noticed 3 errors.

    1. Double semi-colon

    Here are the first 6 lines from Model file

    <?php
    
    namespace App\Models;
    
    use Illuminate\Database\Eloquent\Model;
     use Illuminate\Database\Eloquent\SoftDeletes;; use Illuminate\Database\Eloquent\Factories\HasFactory;;
    

    The 2nd and 3rd imports have repeated semi-colons at the end.

    2. Incorrect spacing and new lines in top section

    In the code block above we can also see some white space added before the keyword use, which should not be there.

    We also see that two use statements are in the same line, which is incorrect and inconsistent with every other generated file, the white space before the second use should be replaced with \n.

    Another \n should be added right after the second use statement, there is no new line between it and the line below (not an import).

    3. Incorrect use of tabs inside model class

    Here are the first few lines in the generated model class

     */class User extends Model
    {
         use SoftDeletes;    use HasFactory;    public $table = 'users';
    
        public $fillable = [
    

    Firstly, we can see there should be a \n before the class keyword, which is not present.

    Secondly: the first 3 statements in the class are present on the same line, with tabs in place of new lines.

    Thirdly: the aforementioned statements have white space before them that should not be present, clearly visible on use SoftDeletes;

    opened by Mosaab-Emam 0
  • [Feature] Generate policy

    [Feature] Generate policy

    Add an option to generate a policy file in config/laravel_generator.php, like this:

    return = [
        ...
        'policy' => true
        ...
    ]
    

    Assuming we are generating a model named Post, setting this option to true should:

    1. Generate a PostPolicy file.
    2. Register the policy in app/Providers/AuthServiceProvider.php
    3. Implement Policy inside controller via user model

    Caveat: policy must be implemented via user model, as implementing via controller helpers or via middleware both require implementation of route model binding, which cannot be applied when using repository pattern.

    Suggestion: It's possible to use any of the 3 patterns when 'repository_pattern' => false, so another option might be generating different code depending on the value of repository_pattern config.

    opened by Mosaab-Emam 0
  • [Feature] Implement route-model binding by default

    [Feature] Implement route-model binding by default

    Assuming laravel_generator.php:

    return = [
      ...
      'repository_pattern' => false,
      'resources' => false,
      ...
    ]
    

    And assuming we are generating a model named Post, here's what gets generated in PostController.php:

      // code
    
      public function show($id): JsonResponse
      {
          /** @var Post $post */
          $post = Post::find($id);
    
          if (empty($post)) {
              return $this->sendError(
                  __('messages.not_found', ['model' => __('models/post.singular')])
              );
          }
    
          return $this->sendResponse(
              $post->toArray(),
              __('messages.retrieved', ['model' => __('models/post.singular')])
          );
      }
    
      // code
    

    This does not implement route model binding, which is a sane default in any project with policies. For example, this pattern is required if the developer wishes to implement policies via middleware or via controller helpers.

    My suggestion is to generate code similar to this:

      // code
    
      public function show(Post $post): JsonResponse
      {
          if (empty($post)) {
              return $this->sendError(
                  __('messages.not_found', ['model' => __('models/post.singular')])
              );
          }
    
          return $this->sendResponse(
              $post->toArray(),
              __('messages.retrieved', ['model' => __('models/post.singular')])
          );
      }
    
      // code
    

    This returns identical results, while helping implement policies out of the box.

    The caveat is that it's not a sane default when using the repository pattern, so this should only apply when that option is set to false.

    opened by Mosaab-Emam 0
  • Foreign Key Not working on Select Dropdown

    Foreign Key Not working on Select Dropdown

    When I create a Scaffold "php artisan infyom:api_scaffold Country --relations" like this or "php artisan infyom:api_scaffold Country" this command using foreign key relation to other table, then Not showing any data in dropdown. check the image Screenshot 2022-11-24 000811 from_filed

    opened by lifewaypn 0
  • [BUG]: Always print the max:? rule for all string fields

    [BUG]: Always print the max:? rule for all string fields

    v5.4.1 Some rules are generated, but not every time (max:) ? Why does it not always appear for string field. All rules can be get from Doctrine\DBAL\Schema\AbstractSchemaManager, $details = $this->schemaManager->listTableDetails($this->tableName); which will always tell you the string length: image

    In this case string length is 10 so we should have max:10 but this does not appear in models $rules 'account' => 'required|string', Some fields do have it, but I think it should always be put in string type field rules.

    opened by jarkko-hautakorpi 1
Releases(v5.4.2)
  • v5.4.2(Dec 22, 2022)

    What's Changed

    • Add locale/ar translation files by @Mosaab-Emam in https://github.com/InfyOmLabs/laravel-generator/pull/1051
    • Always add max: validation to string type fields. by @jarkko-hautakorpi in https://github.com/InfyOmLabs/laravel-generator/pull/1046
    • Fix migration-genaration dbType without ":" by @msksbt in https://github.com/InfyOmLabs/laravel-generator/pull/1044
    Source code(tar.gz)
    Source code(zip)
  • v5.4.1(Sep 19, 2022)

  • v5.4.0(Aug 27, 2022)

  • v5.3.0(Aug 4, 2022)

  • v5.2.0(Jul 25, 2022)

    Features

    • Support added to use vendor publish Templates. Read docs here for more

    Changes

    • Lot of function's visibility changed from private to protected for overriding support

    Removed

    • Publish Layout Command Removed (use laravel's inbuilt publish views instead). Read docs above
    Source code(tar.gz)
    Source code(zip)
  • v5.1.0(Jul 24, 2022)

  • v5.0.0(Jul 21, 2022)

    New Features

    • All Templates are refactored with Blade Templates
    • Livewire Tables Support Added
    • Major Refactoring for various templates & code
    • Publish Tables command for easy tables integration for DataTables and Livewire Tables

    Changes

    • config file is now published to the config folder directly instead of config/infyom
    • various test cases added with pestphp
    • tableName option renamed to table
    • swagger documentation improved
    • Improved file input with extended documentation

    Removed

    • jqueryDT support removed
    • Various options were removed due to config file support including save, paginate, datatables, softDelete, factory, seeder, localized, repositoryPattern, resources
    • Layout Publish Command removed with improved use of laravel-ui-adminlte
    Source code(tar.gz)
    Source code(zip)
  • v4.2.2(Jun 29, 2022)

  • v4.2.1(Jun 23, 2022)

  • v4.2.0(Jun 23, 2022)

    Release Notes

    • Fix: Exit after invalid Rollback Type
    • Enhancement: Improved Factory Generation for Relationships (thanks to @xwiz)
    • Fix: use the default Eloquent model in the Model generation
    • Enhancement: Support for Latest Swagger Generation v3
    • Enhancement: export readOnly and nullable fields in swagger schema (thanks to @Orteko)
    • Removed: API Version specification removed
    Source code(tar.gz)
    Source code(zip)
  • v4.1.1(Jun 23, 2022)

  • v4.1.0(Jun 22, 2022)

  • v4.0.0(Feb 25, 2022)

  • v3.2.0(Feb 3, 2022)

  • v3.1.1(Aug 10, 2021)

  • v2.1.1(Aug 10, 2021)

  • v1.1.1(Aug 10, 2021)

  • v3.1.0(Jul 7, 2021)

  • v2.1.0(Jul 7, 2021)

  • v1.1.0(Jul 7, 2021)

  • v3.0.0(Jun 4, 2021)

  • v2.0.0(Jun 4, 2021)

  • v1.0.0(Jun 4, 2021)

Owner
InfyOmLabs (InfyOm Technologies)
India's Leading Laravel Development Company, Working in Laravel since 2014
InfyOmLabs (InfyOm Technologies)
:rocket: A Smart CRUD Generator For Laravel

Features Generate your models, views, controllers, routes and migrations just in a few clicks. Models visualization through a graph presentation (New

Houssain Amrani 891 Dec 23, 2022
Laravel API Documentation Generator

Laravel API Documentation Generator Automatically generate your API documentation from your existing Laravel/Lumen/Dingo routes. php artisan apidoc:ge

Marcel Pociot 3.3k Dec 21, 2022
Module Generator Composer Package For Laravel

Module Generator Installation You can install the package via composer: composer require teacoders/module-generator Run the command below to publish t

Tea Coders 21 Jan 8, 2022
Trial account generator for NoPing

NoPing account generator (beta version) Trial account generator for NoPing TODO It is working add some errors checks Add a good readme Host the server

Benjamin 6 Sep 6, 2022
A code generator for EasySwoole

wise-generator-easyswoole 基于EasySwoole的code-generation改写,主要应用与内部系统。基本上所有类都有所调整,同时也完善了一些功能。 版本说明 版本说明 code-generation 使用命令行,一键生成业务通用代码,支持代码如下: 一键生成项目初始

Ryan 3 Jun 8, 2021
A PHP README File Generator, to generate easily your GitHub README files 🎉

Readme Generator ?? Requiremennts ?? Make sure you have PHP 8.0 or higher installed. Steup ⚙️ Install Composer v2 or higher (https://getcomposer.org)

♚ PH⑦ de Soria™♛ 9 Oct 18, 2022
Laravel IDE Helper

Laravel IDE Helper Generator Complete PHPDocs, directly from the source This package generates helper files that enable your IDE to provide accurate a

Barry vd. Heuvel 12.8k Dec 29, 2022
This package extends the core file generators that are included with Laravel 5

Extended Migration Generators for Laravel 6, 7 and 8 Easily define the migration schema right in your make:migration command. The new commands this pa

Laracasts 2.4k Dec 29, 2022
⛔️ Laravel Tinx is archived and no longer maintained.

⛔️ Laravel Tinx (Deprecated) Laravel Tinx was archived on 12th December 2019 and is no longer maintained. Looking for a reloadable version of Laravel

James Furey 440 Dec 27, 2022
A cli tool for creating Laravel packages

Laravel Packager This package provides you with a simple tool to set up a new package and it will let you focus on the development of the package inst

JeroenG 1.3k Dec 22, 2022
A MySQL Workbench plugin which exports a Model to Laravel 5 Migrations

MySQL Workbench Export Laravel 5 Migrations Plugin A MySQL Workbench plugin that allows for exporting a model to Laravel 5 migrations that follow PSR-

Brandon Eckenrode 902 Jan 2, 2023
⚙️ A Laravel package to decompose your installed packages, their dependencies, your app & server environment

Introduction Laravel Decomposer decomposes and lists all the installed packages and their dependencies along with the Laravel & the Server environment

LUBUS 513 Dec 30, 2022
🍪 Write gorgeous documentation for your products using Markdown inside your Laravel app.

LaRecipe Write gorgeous documentations for your products using Markdown inside your Laravel app. LaRecipe ?? LaRecipe is simply a code-driven package

Saleem Hadad 2.1k Dec 29, 2022
Prequel for Laravel. Clear and concise database management.

TL;DR? Test Prequel here! What is Prequel exactly? Prequel is meant to be a database management tool for Laravel to replace the need for separate stan

Protoqol 1.4k Dec 27, 2022
Drupal Composer Scaffold - A flexible Composer project scaffold builder

This project provides a composer plugin for placing scaffold files (like index.php, update.php, …) from the drupal/core project into their desired location inside the web root. Only individual files may be scaffolded with this plugin.

Drupal 44 Sep 22, 2022
Generator-hedley - Scaffold a headless Drupal backend, Angular app client, and Behat tests

generator-hedley Scaffold a headless Drupal backend, Angular app client, and Behat tests Hedley is a yeoman generator that scaffolds a headless Drupal

null 99 Jun 3, 2022
Laravel generator with GUI. Generate crud / scaffold.

Laravel generator with GUI. Generate crud / scaffold.

George 420 Dec 5, 2022
Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless development of your applications.

Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless develop

AppzCoder 1.3k Jan 2, 2023
Scaffold generator for Laravel 5.x

Laravel 5.x Scaffold Generator Usage Step 1: Install Through Composer composer require 'laralib/l5scaffold' --dev Step 2: Add the Service Provider Op

null 315 Dec 8, 2022