laravel-code-generator

An efficient Laravel code generator, saving time by automating the creation of resources such as views, controllers, routes, migrations, languages, and form-requests. Highly flexible and customizable, it includes a cross-browser compatible template and client-side validation for application modernization.

MIT License

Downloads
70.3K
Stars
728
Committers
17

Introduction

An intelligent code generator for Laravel framework that will save you time! This awesome tool will help you generate resources like views, controllers, routes, migrations, languages and/or form-requests! It is extremely flexible and customizable to cover many on the use cases. It is shipped with cross-browsers compatible template, along with a client-side validation to modernize your application.

For full documentation and live demo please visit CrestApps.com

Features

  • Craft clean, reusable, and highly readable code for seamless development.
  • Generate complete resources effortlessly with a single command, supporting both migration and existing database scenarios.
  • Streamline resource creation for all existing database tables with a single command.
  • Save and recreate fields using a JSON file, ensuring adaptability to changing business needs.
  • Leverage JSON-based resource files for easy regeneration, even when business rules evolve.
  • Generate standard CRUD controllers with simple or form-request validation.
  • Customize view templates to alter the standard look and feel of your application.
  • Create models with relations for comprehensive data representation.
  • Establish named routes with and without grouping for efficient navigation.
  • Generate standard CRUD views to facilitate a consistent user experience.
  • Smart migration engine tracks generated migrations to only create necessary ones.
  • Intelligent handling of model relations to simplify development.
  • Highly flexible with rich configurable options to suit diverse needs.
  • Easy commands for resource-file creation, addition, or reduction.
  • Full support for generating multi-language applications.
  • Implement client-side validation for enhanced user interaction.
  • Efficiently handle file uploading and store multiple responses in the database.
  • Generate form-request to clean up controllers and boost code reusability.
  • Create view layouts with and without client-side validation.
  • Change templates at runtime for diverse view generation.
  • Ability to generate views with or without Laravel-Collective integration.
  • Seamless handling of date, time, or datetime fields.
  • Automatic management of boolean fields for hassle-free development.

Installation

  1. To download this package into your Laravel project, use the command-line to execute the following command

    composer require crestapps/laravel-code-generator --dev
    
  2. (You may skip this step when using Laravel >= 5.5) To bootstrap the packages into your project while using command-line only, open the app/Providers/AppServiceProvider.php file in your project. Then, add the following code to the register() method.

    Add the following line to bootstrap laravel-code-generator to the framework.

    if ($this->app->runningInConsole()) {
        $this->app->register('CrestApps\CodeGenerator\CodeGeneratorServiceProvider');
    }
    

Lessons

Checkout our channel on YouTube.com

Available Commands

The command in between the square brackets [] must be replaced with a variable of your choice.

Contribution

Are you interested in supporting this project and making a contribution? Here's how you can get involved:

  • Begin by showing your appreciation for this package on GitHub by giving it a star.
  • Share this project with others to encourage ongoing enhancements and the introduction of new features.
  • Report any bugs, provide comments, share ideas, or express your thoughts about this project by creating an issue on GitHub.
  • Contributors are encouraged! If you're passionate about this project, consider addressing existing issues by submitting a pull request.
  • If possible, consider sponsoring the project.

What did you create with this package?

I'd love to know if your site was generated using this package and list your logo on the documentation site. Please email using my contact info found in composer.json file.

Examples

The following example assumes that we are trying to create a CRUD called AssetCategory with the fields listed below.

  • id
  • name
  • description
  • is_active

Basic example - CRUD with migration

Basic example - CRUD with migration - Shortcut

Basic API example - CRUD with migration

Basic example using translations for English and Arabic - with migration

Basic example with form-request

Basic example with soft-delete and migration

Creating resources from existing database

Creating resources from existing database with translation for English and Arabic

Creating resources from existing database with translation for English and Arabic in two step for better control over the fields!

s

  • Upgrade Guide

License

"Laravel Code Generator" is an open-sourced software licensed under the MIT license

Package Rankings
Top 2.51% on Packagist.org
Badges
Extracted from project README's
Tweet
Related Projects