{"id":14974672,"url":"https://github.com/crestapps/laravel-code-generator","last_synced_at":"2025-04-10T17:15:30.800Z","repository":{"id":40775491,"uuid":"77752398","full_name":"CrestApps/laravel-code-generator","owner":"CrestApps","description":"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.","archived":false,"fork":false,"pushed_at":"2025-04-02T15:06:41.000Z","size":2699,"stargazers_count":752,"open_issues_count":39,"forks_count":158,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-04-03T09:04:38.360Z","etag":null,"topics":["code-generation","code-generator","crestapps","crud","crud-builder","crud-generator","crud-maker","generator","laravel-code-generator","laravel-crud-generator","laravel-framework","laravel-package","laravel5-package","mike-alhayek","php-artisan","view-creator"],"latest_commit_sha":null,"homepage":"https://laravel-code-generator.crestapps.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrestApps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"malhayek","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2016-12-31T18:51:45.000Z","updated_at":"2025-03-30T05:21:09.000Z","dependencies_parsed_at":"2024-01-15T09:05:35.124Z","dependency_job_id":"18df27cf-da15-4ec6-80d2-d3f0d0ddebed","html_url":"https://github.com/CrestApps/laravel-code-generator","commit_stats":{"total_commits":306,"total_committers":18,"mean_commits":17.0,"dds":"0.37254901960784315","last_synced_commit":"e9a900503296ea64d81445c82653d98b4b41b6f9"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrestApps%2Flaravel-code-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrestApps%2Flaravel-code-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrestApps%2Flaravel-code-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrestApps%2Flaravel-code-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrestApps","download_url":"https://codeload.github.com/CrestApps/laravel-code-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261916,"owners_count":21074225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","code-generator","crestapps","crud","crud-builder","crud-generator","crud-maker","generator","laravel-code-generator","laravel-crud-generator","laravel-framework","laravel-package","laravel5-package","mike-alhayek","php-artisan","view-creator"],"created_at":"2024-09-24T13:50:54.236Z","updated_at":"2025-04-10T17:15:30.765Z","avatar_url":"https://github.com/CrestApps.png","language":"PHP","readme":"\n[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=An%20intelligent%20code%20generator%20for%20Laravel%20framework%20which%20will%20save%20you%20lots%20of%20time!\u0026url=https://github.com/CrestApps/laravel-code-generator\u0026hashtags=laravel,laravel-code-generator,laravel-crud,code-generator,crud-generator,laravel-crud-generator)\n\n## Introduction\n\nAn 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.\n\nFor full documentation and live demo please visit \u003ca href=\"https://laravel-code-generator.crestapps.com\" target=\"_blank\" title=\"Laravel Code Generator Documentation\"\u003eCrestApps.com\u003c/a\u003e\n\n## Features\n\n- Craft clean, reusable, and highly readable code for seamless development.\n- Generate complete resources effortlessly with a single command, supporting both migration and existing database scenarios.\n- Streamline resource creation for all existing database tables with a single command.\n- Save and recreate fields using a JSON file, ensuring adaptability to changing business needs.\n- Leverage JSON-based resource files for easy regeneration, even when business rules evolve.\n- Generate standard CRUD controllers with simple or form-request validation.\n- Customize view templates to alter the standard look and feel of your application.\n- Create models with relations for comprehensive data representation.\n- Establish named routes with and without grouping for efficient navigation.\n- Generate standard CRUD views to facilitate a consistent user experience.\n- Smart migration engine tracks generated migrations to only create necessary ones.\n- Intelligent handling of model relations to simplify development.\n- Highly flexible with rich configurable options to suit diverse needs.\n- Easy commands for resource-file creation, addition, or reduction.\n- Full support for generating multi-language applications.\n- Implement client-side validation for enhanced user interaction.\n- Efficiently handle file uploading and store multiple responses in the database.\n- Generate form-request to clean up controllers and boost code reusability.\n- Create view layouts with and without client-side validation.\n- Change templates at runtime for diverse view generation.\n- Ability to generate views with or without Laravel-Collective integration.\n- Seamless handling of date, time, or datetime fields.\n- Automatic management of boolean fields for hassle-free development.\n\n## Installation\n\n1. To download this package into your Laravel project, use the command-line to execute the following command\n\n\t```\n\tcomposer require crestapps/laravel-code-generator --dev\n\t```\n \n2. **(You may skip this step when using Laravel \u003e= 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.\n\n\tAdd the following line to bootstrap `laravel-code-generator` to the framework.\n\n\t```\n\tif ($this-\u003eapp-\u003erunningInConsole()) {\n\t    $this-\u003eapp-\u003eregister('CrestApps\\CodeGenerator\\CodeGeneratorServiceProvider');\n\t}\n\t```\n\n## Lessons\nCheckout our channel on \u003ca href=\"https://www.youtube.com/channel/UCkEd0nOoRf3o0ahspAu7Y9w/videos\" target=\"_blank\" title=\"CrestApps YouTube Channel\"\u003eYouTube.com\u003c/a\u003e \n* https://youtu.be/l21qNcsMAWg\n* https://youtu.be/infoecfXOCw\n\n\n## Available Commands\n\n\u003e The command in between the square brackets **[]** must be replaced with a variable of your choice.\n\n\u003cul\u003e\n\t\u003cli\u003e\n\t\t\u003cstrong\u003eMain commands\u003c/strong\u003e\n\t\t\u003cul\u003e\n\t\t    \u003cli\u003ephp artisan create:scaffold [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:controller [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:model [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:form-request [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:routes [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:migration [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:language [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:mapped-resources\u003c/li\u003e\n\t    \u003c/ul\u003e\n\t\u003c/li\u003e\n\t\u003cli\u003e\n\t\t\u003cstrong\u003eAPI commands\u003c/strong\u003e\n\t\t\u003cul\u003e\n\t\t    \u003cli\u003ephp artisan create:api-scaffold [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:api-controller [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:api-resources [model-name]\u003c/li\u003e\n\t    \u003c/ul\u003e\n\t\u003c/li\u003e\n\t\u003cli\u003e\n\t\t\u003cstrong\u003eAPI Documentations commands\u003c/strong\u003e\n\t\t\u003cul\u003e\n\t\t    \u003cli\u003ephp artisan api-docs:scaffold [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan api-doc:create-controller [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan api-doc:create-view [model-name]\u003c/li\u003e\n\t    \u003c/ul\u003e\n\t\u003c/li\u003e\n\t\u003cli\u003e\n\t\t\u003cstrong\u003eViews commands\u003c/strong\u003e\n\t\t\u003cul\u003e\n\t\t\t\u003cli\u003ephp artisan create:layout [application-name]\u003c/li\u003e\n\t\t\t\u003cli\u003ephp artisan create:views [model-name]\u003c/li\u003e\n\t\t\t\u003cli\u003ephp artisan create:index-view [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:create-view [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:edit-view [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:show-view [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan create:form-view [model-name]\u003c/li\u003e\n\t    \u003c/ul\u003e\n\t\u003c/li\u003e\n\t\u003cli\u003e\n\t\t\u003cstrong\u003eResource's files commands\u003c/strong\u003e\n\t\t\u003cul\u003e\n\t\t    \u003cli\u003ephp artisan resource-file:from-database [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan resource-file:create [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan resource-file:append [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan resource-file:reduce [model-name]\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan resource-file:delete [model-name]\u003c/li\u003e\n\t    \u003c/ul\u003e\n\t\u003c/li\u003e\n\t\u003cli\u003e\n\t\t\u003cstrong\u003eMigration commands\u003c/strong\u003e\n\t\t\u003cul\u003e\n\t\t    \u003cli\u003ephp artisan migrate-all\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan migrate:rollback-all\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan migrate:reset-all\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan migrate:refresh-all\u003c/li\u003e\n\t\t    \u003cli\u003ephp artisan migrate:status-all\u003c/li\u003e\n\t    \u003c/ul\u003e\n\t\u003c/li\u003e\n\u003c/ul\u003e\n\n\n## Contribution\n\nAre you interested in supporting this project and making a contribution? Here's how you can get involved:\n\n- Begin by showing your appreciation for this package on GitHub by giving it a **star**.\n- Share this project with others to encourage ongoing enhancements and the introduction of new features.\n- Report any bugs, provide comments, share ideas, or express your thoughts about this project by creating an issue on GitHub.\n- Contributors are encouraged! If you're passionate about this project, consider addressing existing issues by submitting a pull request.\n- If possible, consider [sponsoring the project](https://github.com/sponsors/CrestApps).\n\n\n## What did you create with this package?\nI'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.\n\n## Examples\n\nThe following example assumes that we are trying to create a CRUD called \u003cvar\u003eAssetCategory\u003c/var\u003e with the fields listed below.\n\n- id\n- name\n- description\n- is_active\n\n\n#### Basic example - CRUD with migration\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan resource-file:create AssetCategory --fields=id,name,description,is_active\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create resource-file names \u003cvar\u003e/resources/laravel-code-generator/sources/asset_categories.json\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan create:scaffold AssetCategory --with-migration\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create a model \u003cvar\u003eapp/Models/AssetCategory\u003c/var\u003e, a controller \u003cvar\u003eapp/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n#### Basic example - CRUD with migration - Shortcut\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan create:scaffold AssetCategory --with-migration --fields=id,name,description,is_active\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create resource-file names \u003cvar\u003e/resources/laravel-code-generator/sources/asset_categories.json\u003c/var\u003e first. Then, it will create a model \u003cvar\u003eapp/Models/AssetCategory\u003c/var\u003e, a controller \u003cvar\u003eapp/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!\u003c/var\u003e. This is a short way to issuing both `resource-file:create` and `create:scaffold` in one line\u003c/small\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n#### Basic API example - CRUD with migration\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan resource-file:create AssetCategory --fields=id,name,description,is_active\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create resource-file names \u003cvar\u003e/resources/laravel-code-generator/sources/asset_categories.json\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan create:scaffold AssetCategory --with-migration\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create a model \u003cvar\u003eapp/Models/AssetCategory\u003c/var\u003e, a controller \u003cvar\u003eapp/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n#### Basic example using translations for English and Arabic - with migration\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan resource-file:create AssetCategory --fields=id,name,description,is_active --translation-for=en,ar\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create resource-file names \u003cvar\u003e/resources/laravel-code-generator/sources/asset_categories.json\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan create:scaffold AssetCategory --with-migration\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create a model \u003cvar\u003eapp/Models/AssetCategory\u003c/var\u003e, a controller \u003cvar\u003eapp/Http/Controllers/AssetCategoriesController, all views, the routes, and migration class!\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n#### Basic example with form-request\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan resource-file:create AssetCategory --fields=id,name,description,is_active\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create resource-file names \u003cvar\u003e/resources/laravel-code-generator/sources/asset_categories.json\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan create:scaffold AssetCategory --with-form-request\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create a model \u003cvar\u003eapp/Models/AssetCategory\u003c/var\u003e, a controller \u003cvar\u003eapp/Http/Controllers/AssetCategoriesController, all views, the routes, and \u003cvar\u003eapp/Http/Requests/AssetCategoriesFormRequest\u003c/var\u003e class!\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n#### Basic example with soft-delete and migration\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan resource-file:create AssetCategory --fields=id,name,description,is_active\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create resource-file names \u003cvar\u003e/resources/laravel-code-generator/sources/asset_categories.json\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan create:scaffold AssetCategory --with-soft-delete --with-migration\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create a model \u003cvar\u003eapp/Models/AssetCategory\u003c/var\u003e, a controller \u003cvar\u003eapp/Http/Controllers/AssetCategoriesController, all views, the routes, and migration file!\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n#### Creating resources from existing database\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan create:scaffold AssetCategory --table-exists\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create resource-file names \u003cvar\u003e/resources/laravel-code-generator/sources/asset_categories.json\u003c/var\u003e. 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 \u003cvar\u003e--table-name=some_other_table_name\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003csmall\u003eThen it will create a model \u003cvar\u003eapp/Models/AssetCategory\u003c/var\u003e, a controller \u003cvar\u003eapp/Http/Controllers/AssetCategoriesController, all views and the routes!\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eYou may also create a resource-file from existing database separately using \u003ccode\u003ephp artisan resource-file:from-database AssetCategory\u003c/code\u003e\u003c/small\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\n#### Creating resources from existing database with translation for English and Arabic\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan create:scaffold AssetCategory --translation-for=en,ar --table-exists\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create resource-file names \u003cvar\u003e/resources/laravel-code-generator/sources/asset_categories.json\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThen it will create a model \u003cvar\u003eapp/Models/AssetCategory\u003c/var\u003e, a controller \u003cvar\u003eapp/Http/Controllers/AssetCategoriesController, all views and the routes!\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eYou may also create a resource-file from existing database separately using \u003ccode\u003ephp artisan resource-file:from-database AssetCategory --translation-for=en,ar\u003c/code\u003e\u003c/small\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n#### Creating resources from existing database with translation for English and Arabic in two step for better control over the fields!\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan resource-file:from-database AssetCategory --translation-for=en,ar\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003ephp artisan create:scaffold AssetCategory\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThe above command will create resource-file names \u003cvar\u003e/resources/laravel-code-generator/sources/asset_categories.json\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003cp\u003e\u003csmall\u003eThen it will create a model \u003cvar\u003eapp/Models/AssetCategory\u003c/var\u003e, a controller \u003cvar\u003eapp/Http/Controllers/AssetCategoriesController, all views and the routes!\u003c/var\u003e\u003c/small\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\ns\n* \u003ca href=\"https://crestapps.com/laravel-code-generator/docs/2.3#upgrade-guide\"\u003eUpgrade Guide\u003c/a\u003e\n\n## License\n\n\"Laravel Code Generator\" is an open-sourced software licensed under the \u003ca href=\"https://opensource.org/licenses/MIT\" target=\"_blank\" title=\"MIT license\"\u003eMIT license\u003c/a\u003e\n","funding_links":["https://github.com/sponsors/malhayek","https://github.com/sponsors/CrestApps"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrestapps%2Flaravel-code-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrestapps%2Flaravel-code-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrestapps%2Flaravel-code-generator/lists"}