An intelligent code generator for Laravel framework that will save you time

Overview

Tweet

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

**Note: ** The available documentation is for versions <= 2.2. The documentation for vertion 2.3+ is very similar with some exceptions. Please review the Change Log to get a list of the changes.

Features

  • One step installation when using Laravel 5.5+
  • Create very clean, reusable and highly readable code to build on.
  • Create full resources using a single command with migration or from existing database.
  • Creates full resources for all of the existing tables in the database using one command.
  • Create full API-based resources using a single command with migration or from existing database.
  • Create beautiful documentation for your API.
  • Create api-resource and api-resource-collection with Laravel 5.5+.
  • Allows you to save the fields in a JSON file and recreate resources when the business needs changes.
  • Utilizes JSON based resource-file to allow you to define your resources. Resource-file allows you to easily regenerate the resource at any time even when the business rules change.
  • Create standard CRUD controllers with simple or form-request validation.
  • Customizable view’s templates to enable you to change the standard look and feel of your application.
  • Create model with relations.
  • Create named routes with and without group.
  • Create standard CRUD views.
  • Smart migration engine! Keeps track of all generated migrations to only create the needed migration.
  • Intelligent enough to automatically handles the relations between the models.
  • Very flexible and rich with configurable options.
  • Easy commands to create resource-file; additionally, add or reduce existing resource-file.
  • Full capability to generate multi-languages applications.
  • Client-side validation.
  • File uploading handling.
  • Auto store multiple-response in the database.
  • Create form-request to clean up your controller and increase your code reusability.
  • Create view's layouts with and without client-side validation.
  • Change the template at run time to generate different views.
  • Ability to generate views with and without Laravel-Collective.
  • Nicely handles any date, time or datetime field.
  • Auto handles any boolean field.
  • Very easy to use with lots of documentation.

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');
    }
    

A layout is required for the default views! The code generator allows you to create a layout using the command-line. Of cource you can use your own layout. You'll only need to include CSS bootstrap framework in your layout for the default templates to work properly. Additionally, you can chose to you design your own templetes using a different or no css framework.

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.

  • Main commands
    • php artisan create:scaffold [model-name]
    • php artisan create:controller [model-name]
    • php artisan create:model [model-name]
    • php artisan create:form-request [model-name]
    • php artisan create:routes [model-name]
    • php artisan create:migration [model-name]
    • php artisan create:language [model-name]
    • php artisan create:mapped-resources
  • API commands
    • php artisan create:api-scaffold [model-name]
    • php artisan create:api-controller [model-name]
    • php artisan create:api-resources [model-name]
    • php artisan api-doc:create-controller [model-name]
    • php artisan api-doc:create-view [model-name]
  • Views commands
    • php artisan create:layout [application-name]
    • php artisan create:views [model-name]
    • php artisan create:index-view [model-name]
    • php artisan create:create-view [model-name]
    • php artisan create:edit-view [model-name]
    • php artisan create:show-view [model-name]
    • php artisan create:form-view [model-name]
  • Resource's files commands
    • php artisan resource-file:from-database [model-name]
    • php artisan resource-file:create [model-name]
    • php artisan resource-file:append [model-name]
    • php artisan resource-file:reduce [model-name]
    • php artisan resource-file:delete [model-name]
  • Migration commands
    • php artisan migrate-all
    • php artisan migrate:rollback-all
    • php artisan migrate:reset-all
    • php artisan migrate:refresh-all
    • php artisan migrate:status-all

Full documentation available at CrestApps.com.

Live demo is available at CrestApps.com.

Upgrading from version <= 2.2 to 2.3+

  • Delete the codegenerator.php file found in your config folder, then rename the codegenerator_custom.php file to laravel-code-generator.php if one exists. Alternatively, you can delete both codegenerator.php and codegenerator_custom.php

Contribution

Do you like this project and want to contribute?

  • HELP WANTED Version v2.3 needs to be documented before it can be released. If you are able to contribute, please read the change-log in v2.3 branch and document it in the CrestApps-site repository. For any help, my email can be found in the composer.json file, feel free to send me an email.
  • Please start by Staring this package on GitHub.
  • Sharing this projects with others is your way of saying keep improvements and new awesome feature coming.
  • Report any bugs or send us any comments, idea, thought that you may have about this project as an issue on GitHub.

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

php artisan resource-file:create AssetCategory --fields=id,name,description,is_active

The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json

php artisan create:scaffold AssetCategory --with-migration

The above command will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!

Basic example - CRUD with migration - Shortcut

php artisan create:scaffold AssetCategory --with-migration --fields=id,name,description,is_active

The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json first. Then, it will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!. This is a short way to issuing both `resource-file:create` and `create:scaffold` in one line

Basic API example - CRUD with migration

php artisan resource-file:create AssetCategory --fields=id,name,description,is_active

The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json

php artisan create:scaffold AssetCategory --with-migration

The above command will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!

Basic example using translations for English and Arabic - with migration

php artisan resource-file:create AssetCategory --fields=id,name,description,is_active --translation-for=en,ar

The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json

php artisan create:scaffold AssetCategory --with-migration

The above command will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!

Basic example with form-request

php artisan resource-file:create AssetCategory --fields=id,name,description,is_active

The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json

php artisan create:scaffold AssetCategory --with-form-request

The above command will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and app/Http/Requests/AssetCategoriesFormRequest class!

Basic example with soft-delete and migration

php artisan resource-file:create AssetCategory --fields=id,name,description,is_active

The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json

php artisan create:scaffold AssetCategory --with-soft-delete --with-migration

The above command will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views, the routes, and migration file!

Creating resources from existing database

php artisan create:scaffold AssetCategory --table-exists

The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json. It is going to assume that the table name is called "asset_categories" in your database. If that is not the case, you can use --table-name=some_other_table_name

Then it will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views and the routes!

You may also create a resource-file from existing database separately using php artisan resource-file:from-database AssetCategory

Creating resources from existing database with translation for English and Arabic

php artisan create:scaffold AssetCategory --translation-for=en,ar --table-exists

The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json

Then it will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views and the routes!

You may also create a resource-file from existing database separately using php artisan resource-file:from-database AssetCategory --translation-for=en,ar

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

php artisan resource-file:from-database AssetCategory --translation-for=en,ar

php artisan create:scaffold AssetCategory

The above command will create resource-file names /resources/laravel-code-generator/sources/asset_categories.json

Then it will create a model app/Models/AssetCategory, a controller app/Http/Controllers/AssetCategoriesController, all views and the routes!

What's new?

License

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

Comments
  • Error when try to generate resources from database

    Error when try to generate resources from database

    Environment:

    • Laravel-Code-Generator Version: 2.2.7
    • Laravel Version: 5.5.28

    Description:

    When I tried to generate a resource file from any table apart from users I got the next error:

    In Field.php line 1117:
     Undefined index: labels
    

    Steps/Commands To Reproduce:

    e.g: php artisan create:resources --routes-prefix=admin --table-exists --views-directory=groups Group

    groups table has an id and a varchar field

    opened by ghost 23
  • Suggestion: allow all singular

    Suggestion: allow all singular

    In latin languages (spanish portuguese italian french romanian) compound words go inverse than english. Example:

    in english you say: "User types"

    in spanish it is "Tipos de Usuario" maybe valid "Tipos de Usuarios" maybe valid "Tipo de Usuarios"

    this becomes a mess!

    Imagine the possible foreign keys

    User->tipos_de_usuario_id
    User->tipos_de_usuarios_id
    User->tipo_de_usuarios_id
    User->tipo_de_usuarios_id
    

    Lots of programmers I know, including me, prefer to use all singular, for models, controllers, tables, views, routes, etc

    It would be amazing to have that option!

    enhancement 
    opened by eduardoarandah 21
  • QUESTION: [feature request] New ways to define relationships

    QUESTION: [feature request] New ways to define relationships

    It's great to be able to define relationships through the models (and resources) generation command, but i find it not easy to do it through the shell when the models are complex, with many relationships.

    Is it possible to:

    • add a way to (manually) define relationships directly in the fields definition json file and / or
    • automatically extrapolate the relations form an existing table - based on the names when tables / fields are following the naming conventions (or based on foreign key definitions in the database, whichever is easier to implement / maintain).
    enhancement question 
    opened by essemme 15
  • Controllers generated with errors

    Controllers generated with errors

    Environment:

    • Laravel-Code-Generator Version: 2.3.2
    • Laravel Version: 5.8.*

    Description:

    Hi, I installed the last version of laravel code generator (v2.3.2). But it generate controllers with some errors. For example, the [% use_command_placeholder %] include use App\Http\Controllers\Controller insteed of use App\Http\Controllers\Controller. In the first one, you can notice that there is a double '\' before Controller. The model using have the same error. More over, Before every method always in controllers, the PHPDocs have some errors. It Generate for example '@return Illuminate\View\View' instead of '@return \Illuminate\View\View' with '' before Illuminate. I can correct the last one in the template but i don't know how to correct the first one included by [% use_command_placeholder %].

    Steps/Commands To Reproduce:

    composer require crestapps/laravel-code-generator --dev php artisan create:scaffold Test --fields=id,first_field,second_field --with-migration

    Content Of The Resource-File:

    { "fields": [ { "name": "id", "labels": "Id", "html-type": "text", "css-class": "", "options": {}, "html-value": null, "validation": "", "is-on-index": false, "is-on-show": false, "is-on-form": false, "data-type": "int", "data-type-params": [], "data-value": null, "is-index": false, "is-unique": false, "is-primary": true, "comment": null, "is-nullable": false, "is-header": false, "is-unsigned": true, "is-auto-increment": true, "is-inline-options": false, "is-date": false, "date-format": "", "cast-as": "", "placeholder": "Enter id here...", "delimiter": "; ", "range": [], "foreign-relation": null, "foreign-constraint": null, "on-store": null, "on-update": null, "api-key": "id", "is-api-visible": true, "api-description": "The id of the model." }, { "name": "first_field", "labels": "First Field", "html-type": "text", "css-class": "", "options": {}, "html-value": null, "validation": "required|string|min:1", "is-on-index": true, "is-on-show": true, "is-on-form": true, "data-type": "string", "data-type-params": [], "data-value": null, "is-index": false, "is-unique": false, "is-primary": false, "comment": null, "is-nullable": false, "is-header": false, "is-unsigned": false, "is-auto-increment": false, "is-inline-options": false, "is-date": false, "date-format": "", "cast-as": "", "placeholder": "Enter first field here...", "delimiter": "; ", "range": [], "foreign-relation": null, "foreign-constraint": null, "on-store": null, "on-update": null, "api-key": "first_field", "is-api-visible": true, "api-description": "The first field of the model." }, { "name": "second_field", "labels": "Second Field", "html-type": "text", "css-class": "", "options": {}, "html-value": null, "validation": "string|min:1", "is-on-index": true, "is-on-show": true, "is-on-form": true, "data-type": "string", "data-type-params": [], "data-value": null, "is-index": false, "is-unique": false, "is-primary": false, "comment": null, "is-nullable": true, "is-header": false, "is-unsigned": false, "is-auto-increment": false, "is-inline-options": false, "is-date": false, "date-format": "", "cast-as": "", "placeholder": "Enter second field here...", "delimiter": "; ", "range": [], "foreign-relation": null, "foreign-constraint": null, "on-store": null, "on-update": null, "api-key": "second_field", "is-api-visible": true, "api-description": "The second field of the model." } ], "relations": [], "indexes": [], "auto-manage-created-and-updated-at": true, "table-name": null, "protection": { "is-model-protected": false, "is-controller-protected": false, "is-api-resource-protected": false, "is-api-resource-collection-protected": false, "is-api-documentation-protected": false, "is-api-documentation-controller-protected": false, "is-form-request-protected": false, "is-languages-protected": false, "is-form-view-protected": false, "is-index-view-protected": false, "is-create-view-protected": false, "is-edit-view-protected": false, "is-show-view-protected": false }, "api-documentation": { "access_token_with_bearer": "The access token prefixed with the \"Bearer \" key word.", "index_route_description": "Retrieve existing tests.", "index_route_response_description": "The API's response will be JSON based data. The JSON object will be structured as follow", "the_key_is_the_model_property_and_the_value_is_the_model_value": "The array's key is the test property name where the value is the assigned value to the retrieved test.", "link_to_retrieve_first_page": "Link to retrieve first page.", "link_to_retrieve_last_page": "Link to retrieve last page.", "link_to_retrieve_previous_page": "Link to retrieve previous page.", "link_to_retrieve_next_page": "Link to retrieve next page.", "the_number_of_current_page": "The number of current page.", "the_index_of_the_first_retrieved_item": "The index of first retrieved test.", "the_number_of_the_last_page": "The number of the last page.", "the_base_link_to_the_resource": "The base link to the api resource.", "the_number_of_models_per_page": "The number of tests per page.", "the_index_of_the_last_retrieved_item": "The index of last retrieved test.", "the_total_of_available_pages": "The total of the available pages.", "store_route_description": "Create new test.", "store_route_response_description": "The API's response will be JSON based data. The JSON object will be structured as follow", "update_route_description": "Update existsing test.", "update_route_response_description": "The API's response will be JSON based data. The JSON object will be structured as follow", "show_route_description": "Retrieve existsing test.", "show_route_response_description": "The API's response will be JSON based data. The JSON object will be structured as follow", "the_id_of_model_to_retrieve": "The unique id of the test to retrieve", "destroy_route_description": "Delete existsing test.", "destroy_route_response_description": "The API's response will be JSON based data. The JSON object will be structured as follow", "the_id_of_model_to_delete": "The id of the test to delete.", "general_description": "Allows you to list, create, edit, show and delete tests.", "indicate_whether_the_request_was_successful_or_not": "Indicate whether the request was successful or not.", "the_id_of_the_model": "The id of the test.", "this_parameter_must_be_present_in_the_request": "This parameter must be present in the request.", "the_request_failed_validation": "The request failed validation.", "list_of_the_invalid_errors": "List of the invalid errors.", "the_requested_model_does_not_exists": "The requested test does not exists.", "the_user_does_not_have_permission_to_access_the_requested_resource": "User does not have permission to access the requested resource." } }

    opened by pilabrem 11
  • error

    error

    F:\nidhi - Login Email HtmlCollective CodeGenerator>php artisan create:resources AssetCategory --with-migration Scaffolding resources for asset category... A model was crafted successfully.

    ErrorException : compact(): Undefined variable: viewName

    at F:\nidhi - Login Email HtmlCollective CodeGenerator\vendor\crestapps\laravel-code-generator\src\Commands\CreateControllerCommand.php:398 394| 'template', 395| 'controllerName', 396| 'extends', 397| 'withAuth',

    398| 'controllerDirectory' 399| ); 400| } 401| 402| /**

    Exception trace:

    1 compact("formRequestDirectory", "viewDirectory", "viewName", "modelName", "prefix", "perPage", "fileSnippet", "modelDirectory", "langFile", "fields", "withFormRequest", "formRequestName", "force", "resourceFile", "template", "controllerName", "extends", "withAuth", "controllerDirectory") F:\nidhi - Login Email HtmlCollective CodeGenerator\vendor\crestapps\laravel-code-generator\src\Commands\CreateControllerCommand.php:398

    opened by SV-RAJA 10
  • Namespace models and from-database issue

    Namespace models and from-database issue

    Environment:

    • Laravel-Code-Generator Version: 2.3.#
    • Laravel Version: 5.6.#

    Description:

    When having models with more depth then just App\Models you cant create resource from existing database.

    Steps/Commands To Reproduce:

    php artisan resource-file:from-database "\App\Models\Test\Some" --table-name=tests --translation-for=en,sr

    Content Of The Resource-File:

    image

    opened by nenads 10
  • Undefined variable $column Error with command

    Undefined variable $column Error with command "php artisan create:fields-file [table-name]"

    (Laravel 5.4, code-generator master branch)

    While trying to create the definitions file from a MySql database using the command php artisan create:fields-file whatever-my-table-name I get this error (pasted from the log):

    local.ERROR: exception 'ErrorException' with message 'Undefined variable: column' in [LaravelAppPath]/vendor/crestapps/laravel-code-generator/src/DatabaseParsers/ParserBase.php:96

    (while comparing, with a quick look, the BaseParser / MysqlParser classes methods with the ones in SQLServerParser, it seems something is missing)

    P.S. BTW, great package - I like the clean and effective code of the stubs

    bug 
    opened by essemme 10
  • Custom Model Template - Configuration Options

    Custom Model Template - Configuration Options

    Environment:

    • Laravel-Code-Generator Version:2.2.7
    • Laravel Version: 5.6.12

    Description:

    Attempting to create custom template as suggested in procedures.

    Steps/Commands To Reproduce:

    Specifically trying to create a modified model.stub to add use Cviebrock\EloquentSluggable\Sluggable; and use Sluggable;along the lines of what is currently done with soft deletes. Could not find any procedures for adding such options. Tried simply entering the information in the model.stub, but the model output had blank space where I had entered the information.

    Ultimately, there would probably be many other modifications that would be desirable, but without instructions on how to do it, it's simply a matter of wandering blindly in the dark.

    Content Of The Resource-File:

    See attached text file. entities.txt

    You've got a fantastic generator, far better than most of what I've seen in the Laravel ecosystem that just produce stubs without any content, the type of thing that you can almost type in faster than using the extension. I hope you'll keep up all the great work! It would be really helpful to have some clearer instructions on making custom templates, but I want to say that the rest of your instructions are, just like the generator itself, far superior to most of what I've seen in the Laravel arena. Having worked with Yii2 for many, many years, I'm glad to see that Laravel is finally catching up!

    question 
    opened by larry-tx 9
  • Class 'CrestApps\CodeGenerator\Traits\Str' not found

    Class 'CrestApps\CodeGenerator\Traits\Str' not found

    Environment:

    • Laravel-Code-Generator Version: 2.4.5
    • Laravel Version: 8.63.0

    Description:

    I ran a command: php artisan resource-file:from-database User

    I got an error: Class 'CrestApps\CodeGenerator\Traits\Str' not found at C:\laragon\www\dentit\vendor\crestapps\laravel-code-generator\src\Traits\Migration.php:119

    Fix

    I fixed it with importing Str class in Migration trait: vendor/crestapps/laravel-code-generator/src/Traits/Migration.php:8 --> use CrestApps\CodeGenerator\Support\Str;

    opened by huszerldani 8
  • any bug with creating views?

    any bug with creating views?

    I tried to run examples from doc, but got error as below:

    php artisan fields-file:create AssetCategory --names=id,name,description,is_active --translation-for=en,ar

    it's OK, json was created but then:

    php artisan create:resources AssetCategory

    and something goes wrong with creating views

    Scaffolding resources for asset category...
    A model was crafted successfully.
    A controller was crafted successfully.
    The routes were added successfully.
    Crafting views...
    
                                                                                   
      [ErrorException]                                                             
      Argument 2 passed to CrestApps\CodeGenerator\HtmlGenerators\StandardHtml::g  
      etLabelElement() must be an instance of CrestApps\CodeGenerator\Models\Labe  
      l, boolean given, called in /var/www/crestappdev/vendor/crestapps/laravel-c  
      ode-generator/src/HtmlGenerators/HtmlGeneratorBase.php on line 723 and defi  
      ned
    
    opened by qcol 8
  • language files creating doesn't work

    language files creating doesn't work

    Hi Today I found this Laravel generator and I'm very impressed... It can do much better than a lot older InfyOm or scaffold-interface. Respect - good job!

    So far, one option does not work for me - generating language files. When create resources with options like this: --lang-file-name=products --translation-for=en,pl

    No files are created in lang folder and direct english labels are used in Views. I expected, that lang file (lang/products.php) will be created and __('label_name') will be used in Views files. Am i doing something wrong?

    opened by qcol 8
  • Update to bootstrap 5

    Update to bootstrap 5

    Before you submit an issue please read this

    This repository is only for reporting bugs or issues. If you need support, please use Stack Overflow using laravel-code-generator tag (https://stackoverflow.com/questions/tagged/laravel-code-generator)

    Please provide us with details by completing the following requirements. Issues with not enough info are likely to be closed without resolution.

    Environment:

    • Laravel-Code-Generator Version: 2.4.9
    • Laravel Version: 9.45.1

    Description:

    In this template "laravel-code-generator/templates/default/layout.stub" reference is made to Bootstrap 3.3.6

    opened by gerardp 1
  • Command php artisan resource-file:create not working with --relations parameters

    Command php artisan resource-file:create not working with --relations parameters

    Environment:

    • Laravel-Code-Generator Version: v2.4.4
    • Laravel Version: v8.64.0

    Description:

    Following the documentation, this command php artisan resource-file:create could not work with --relations parameters.

    Steps:

    php artisan resource-file:append Post --fields="name:another" --relations="name:comments;type:hasMany;field:title;params:App\Models\Comment|post_id|id"

    Running the cammand above would generate

    ErrorException

    Undefined offset: 1

    The culprit seems to be the line below

      at ...\crestapps\laravel-code-generator\src\Models\ForeignRelationship.php:490
        486▕             if (!str_contains($part, ':')) {
        487▕                 continue;
        488▕             }
        489▕ 
      ➜ 490▕             list($key, $value) = Str::split([':', '='], $part);
        491▕ 
        492▕             if (($isParams = in_array($key, ['params', 'param'])) || str_contains($value, '|')) {
        493▕                 $value = explode('|', $value);
        494▕
    

    A quick dirty fix was changing the line to:

    list($key, $value) = Str::split(':', $part);

    opened by SulaimanBello 0
  • Laravel 7.x migration reference to `users` table `id` getting error incorrectly formed error

    Laravel 7.x migration reference to `users` table `id` getting error incorrectly formed error

    Before you submit an issue please read this

    This repository is only for reporting bugs or issues. If you need support, please use Stack Overflow using laravel-code-generator tag (https://stackoverflow.com/questions/tagged/laravel-code-generator)

    Please provide us with details by completing the following requirements. Issues with not enough info are likely to be closed without resolution.

    Environment:

    • Laravel-Code-Generator Version: 2.4.4
    • Laravel Version: 7.23.0

    Description:

    When generating migration, that contains a reference to users table id getting error incorrectly formed error. since laravel 7.x id() returns bigIncrements field.

    Steps/Commands To Reproduce:

    change the database engine to InnoDB. Then add a field to migration file something like created_by that references id on users table. Then run the migration.

    Content Of The Resource-File:

    opened by AjithLalps 0
  • Change routes name

    Change routes name

    Is your feature request related to a problem? Please describe.

    When I create a scaffold for a model name "Dummy", the route name are like:

    'dummies.dummy.index' 'dummies.dummy.create' etc...

    Describe the solution you'd like

    I think should be like:

    'dummies.index' 'dummies.create' etc...

    Or am I missing something?

    I run the following commands, without any customization of config or anything else:

    php artisan resource-file:create Dummy --fields=id,name,description,folder,filename,is_active
    php artisan create:scaffold Dummy --with-migration
    

    Also since there is usage of group(), name base could be added like so:

    
    
    Route::group([
        'prefix' => 'dummies',
        'name' => 'dummies.',
    ], function () {
        Route::get('/', 'DummiesController@index')
             ->name('index');
        Route::get('/', 'DummiesController@index')
             ->name('create');
    //...etc...
    });
    
    
    
    enhancement 
    opened by thewebartisan7 3
Releases(v2.4.9)
  • v2.4.9(Sep 9, 2022)

    What's Changed

    • Fix the generated API routes by @MikeAlhayek in https://github.com/CrestApps/laravel-code-generator/pull/187
    • #165 fix by @AjithLalps in https://github.com/CrestApps/laravel-code-generator/pull/168
    • #124 date format missing from model generator by @steveijar in https://github.com/CrestApps/laravel-code-generator/pull/173

    New Contributors

    • @AjithLalps made their first contribution in https://github.com/CrestApps/laravel-code-generator/pull/168
    • @steveijar made their first contribution in https://github.com/CrestApps/laravel-code-generator/pull/173

    Full Changelog: https://github.com/CrestApps/laravel-code-generator/compare/v2.4.8...v2.4.9

    Source code(tar.gz)
    Source code(zip)
  • v2.4.8(Mar 2, 2022)

  • v2.4.7(Nov 29, 2021)

  • v2.4.6(Oct 18, 2021)

  • v2.4.5(Oct 16, 2021)

  • v2.4.4(Nov 12, 2019)

  • v2.4.1(Nov 6, 2019)

  • v2.3.2(Apr 27, 2019)

  • v2.3.3(Jun 16, 2019)

  • v2.3.1(Mar 17, 2019)

  • v2.2.14(Mar 17, 2019)

  • v2.3.0(Mar 3, 2019)

    This release does not yet have official documentation. However, you can get started by reviewing the ChangeLog file

    HELP WANTED Version v2.3 needs to be documented before it can be released. If you are able to contribute, please read the change-log in v2.3 branch and document it in the CrestApps-site repository. For any help, my email can be found in the composer.json file, feel free to send me an email.

    Source code(tar.gz)
    Source code(zip)
  • v2.2.13(Mar 3, 2019)

  • v2.2.12(Aug 11, 2018)

    Fixed #71

    Make sure you publish the resources again after the upgrade to fix the templates.

    php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=default
    
    Source code(tar.gz)
    Source code(zip)
  • v2.2.11(Jul 4, 2018)

  • v2.2.10(May 24, 2018)

  • v2.2.9(Apr 25, 2018)

  • v2.2.8(Mar 20, 2018)

  • v2.2.7(Dec 31, 2017)

    • Added capability to lock down resource from with in the resource file. This is helpful if you make code changes to a file and you want the code generator to protect the file from accidentally overriding it when using --force

    • When creating resources from existing database, the table name is stored in the resource-file. This step will save you from having to provide the table name via command line each time you create model.

    Source code(tar.gz)
    Source code(zip)
  • v2.2.6(Dec 18, 2017)

    Fixes a bug when creating resources from existing MySQL Database where the schema does not meet the standard naming convention.

    There are minor updates to the config file that should be published. After the upgrade, make sure you publish the resources using the following command

    php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=default --force
    
    Source code(tar.gz)
    Source code(zip)
  • v2.2.5(Oct 31, 2017)

  • v2.2.4(Oct 23, 2017)

    Fixed a bug with multipleSelect controls

    If you are upgrading from v2.0, v2.1, v2.2, or 2.3 to v2.4 make sure you publish the vendor resource. There are some updates to the config file.

    php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=default --force
    
    Source code(tar.gz)
    Source code(zip)
  • v2.2.3(Oct 22, 2017)

    Fix couple of bug found in the previous version. Also, improved detecting the foreign header field.

    If you are upgrading from v2.0, v2.1 or v2.2 to v2.3 make sure you publish the vendor resource. There are some updates to the config file.

    php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=default --force
    
    Source code(tar.gz)
    Source code(zip)
  • v2.2.2(Oct 14, 2017)

    Upgrade

    • If you are upgrading from v2.0 or v2.1 to v2.3 make sure you publish the vendor resource. There are some changes to the templates that required to be updated. php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=default --force
    • If you are upgrading any version prior v2.2 follow the upgrade instruction on https://crestapps.com/laravel-code-generator/docs/2.2#upgrade-guide
    Source code(tar.gz)
    Source code(zip)
  • v2.2.1(Oct 11, 2017)

    Fixed couple bugs that caused generating code with Laravel-Collective error.

    For documentation, please visit https://crestapps.com/laravel-code-generator/docs/2.2

    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Oct 10, 2017)

    Version 2.2 introduces very exciting features, more flexibility and less work for you out of the box! It also, adds support for the new features that were introduced in Laravel 5.5

    For more more info visit https://crestapps.com/laravel-code-generator/docs/2.2#release-notes

    A full demo can be found at https://crestapps.com/laravel-code-generator/demos/v2-2

    Full documentation can be found on https://crestapps.com/laravel-code-generator/docs/2.2

    Source code(tar.gz)
    Source code(zip)
  • v2.1.6(Sep 18, 2017)

    fixes a bug in the default-collective template.

    Make sure to publish the template

    php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=default-collective
    
    Source code(tar.gz)
    Source code(zip)
  • v2.1.4(Jul 15, 2017)

Mind is the PHP code framework designed for developers. It offers a variety of solutions for creating design patterns, applications and code frameworks.

Mind Mind is the PHP code framework designed for developers. It offers a variety of solutions for creating design patterns, applications and code fram

null 0 Dec 13, 2021
Laravel 5 nested category/menu generator

Laravel 5 Nestable Laravel Nestable to work with recursive logic. Category level there is no limit but this may vary depending on your server performa

Ahmet 217 Nov 15, 2022
Low-code Framework for Web Apps in PHP

Agile UI - User Interface framework for Agile Toolkit Agile Toolkit is a Low Code framework written in PHP. Agile UI implement server side rendering e

Agile Toolkit 404 Jan 8, 2023
Source code of Ice framework

Ice framework Simple and fast PHP framework delivered as C-extension. Stage How to contribute? Fork the ice/framework repository. Create a new branch

ice framework 340 Nov 15, 2022
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

Slim Framework Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs. Installation It's recommended

Slim Framework 11.5k Jan 4, 2023
Quite possibly the smallest MVC framework you'll ever use.

Swiftlet Swiftlet is quite possibly the smallest MVC framework you'll ever use. And it's swift. Licensed under the MIT license. Buzzword compliance ✔

Elbert Alias 429 Nov 13, 2022
A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast! Condensed in a single ~65KB file

Bong Cosca 2.6k Dec 30, 2022
Simple PHP framework that helps you quickly understand and write simple APIs.

Lightweight-PHP-Framework-For-APIs. Simple PHP framework that helps you quickly understand and write simple APIs. Installation Use the package manager

Youssef Hajjari 24 Jul 22, 2022
Leaf is a PHP framework that helps you create clean, simple but powerful web apps and APIs quickly and easily.

Leaf is a PHP framework that helps you create clean, simple but powerful web apps and APIs quickly and easily. Leaf introduces a cleaner and much simpler structure to the PHP language while maintaining it's flexibility. With a simple structure and a shallow learning curve, it's an excellent way to rapidly build powerful and high performant web apps and APIs.

Leaf Framework 706 Jan 3, 2023
Simple PHP framework that helps you quickly understand and write simple APIs.

Lightweight PHP Framework For Web and APIs PHP framework that helps you write quickly simple but powerful web apps and APIs Installation Use the packa

Youssef Hajjari 24 Jul 22, 2022
Behat is a BDD framework for PHP to help you test business expectations.

Behat is a BDD framework for PHP to help you test business expectations. Installing Behat The easiest way to install Behat is by using Composer: $> co

Behat 3.8k Jan 1, 2023
A simple PHP MVC framework without extra files and codes that you don't need

Welcome to (SPM) Simple PHP MVC, just what you need! This is a simple PHP MVC framework without extra files and codes that you don't need.

Van Hudson Galvoso 5 Sep 17, 2022
Easy to use, fast extendable small PHP Framework, like the one you ever missed. The skeleton-APP

About Tufu-Framework Easy to use, fast extendable PHP Framework, like the one you ever missed. Features included such as: Twig and extensions. Fast ro

Giacomo Barbalinardo 0 Jul 2, 2022
I made my own simple php framework inspired from laravel framework.

Simple MVC About Since 2019, I started learning the php programming language and have worked on many projects using the php framework. Laravel is one

null 14 Aug 14, 2022
I made my own simple php framework inspired from laravel framework.

Simple MVC About Since 2019, I started learning the php programming language and have worked on many projects using the php framework. Laravel is one

Rizky Alamsyah 14 Aug 14, 2022
CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework

CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework. It is free, Open Source and is distributed under Free Public Lice

Nazar Mokrynskyi 150 Apr 12, 2022
PHPR or PHP Array Framework is a framework highly dependent to an array structure.

this is new repository for php-framework Introduction PHPR or PHP Array Framework is a framework highly dependent to an array structure. PHPR Framewor

Agung Zon Blade 2 Feb 12, 2022
Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

Framework X Framework X – the simple and fast micro framework for building reactive web applications that run anywhere. Quickstart Documentation Tests

Christian Lück 620 Jan 7, 2023