{"id":18937751,"url":"https://github.com/webkul/magento2-code-generator","last_synced_at":"2025-10-26T04:46:48.276Z","repository":{"id":47237961,"uuid":"223424367","full_name":"webkul/magento2-code-generator","owner":"webkul","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-13T12:06:22.000Z","size":156,"stargazers_count":41,"open_issues_count":1,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T07:56:40.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/webkul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2019-11-22T14:48:38.000Z","updated_at":"2025-01-14T11:54:01.000Z","dependencies_parsed_at":"2024-05-13T12:53:23.504Z","dependency_job_id":"a5b60f5f-a447-4645-adf5-80331176370c","html_url":"https://github.com/webkul/magento2-code-generator","commit_stats":null,"previous_names":["webkul/magento2-code-generator","ashutoshwebkul/magento2-code-generator"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkul%2Fmagento2-code-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkul%2Fmagento2-code-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkul%2Fmagento2-code-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkul%2Fmagento2-code-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webkul","download_url":"https://codeload.github.com/webkul/magento2-code-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681488,"owners_count":21144700,"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":[],"created_at":"2024-11-08T12:12:20.433Z","updated_at":"2025-10-26T04:46:43.232Z","avatar_url":"https://github.com/webkul.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code Generator For Magento2\n\n# Installation\n\n``` composer require webkul/code-generator ```\n\n``` php -f bin/magento setup:upgrade ```\n\n# User Guide\n\n- [Magento 2 Code Generator](https://webkul.com/blog/magento-2-code-generator/)\n\n# Usage\n\n- To create new Module\n\n``` php bin/magento generate:code Module_Name --type=new-module  ```\n\n- To create models\n\n``` php bin/magento generate:code Module_Name --table=\"table_name\" --type=model --name=ModelName ```\n\nIf you have created the db_schema file for the table in the above command, it will automatically create setter and getter of all the columns in the schema.\n\n- To create repositories\n\n``` php bin/magento generate:code Module_Name --type=repository --name=RepositoryClassName --model-class=ModelClassFullName --collection-class=CollectionClassFullName ```\n\n- To create controller\n\n``` php bin/magento generate:code Module_Name --type=controller --name=ControllerName --area=frontend|adminhtml --path=RelativeToModuleControolerFolder --router=RouteName ```\n\n- To create helper\n\n``` php bin/magento generate:code Module_Name --type=helper --name=HelperName  ```\n\n- To create payment method\n\n``` php bin/magento generate:code Module_Name --type=payment --name=MethodName --payment-code=PaymentMethodCode ```\n\n- To create shipping method\n\n``` php bin/magento generate:code Module_Name --type=shipping --shipping-code=custom_shipping ```\n\n- To create Plugin\n\n``` php bin/magento generate:code Module_Name --type=plugin --name=PluginName --plugin=FullClassName [--area=frontend|adminhtml]  ```\n\n- To create observer\n\n``` php bin/magento generate:code Module_Name --type=observer --name=ObserverName --event=event_name [--area=frontend|adminhtml]  ```\n\n- To create cron\n\n``` php bin/magento generate:code Module_Name --type=cron --name=CronName [--schedule=\"0 1 * * *\"]  ```\n\n\n- To create unit test cases\n\n``` php bin/magento generate:code Module_Name --type=unit-test  ```\n\n\n- To create view\n\n``` php bin/magento generate:code Module_Name --type=create-view --name=webkul_index_index --area=adminhtml --block-class=Main --template=hello.phtml --layout-type=admin-2column-left ```\n\n``` --block-class ```, ``` --template ```, ``` --layout-type ``` are optional.\n\n- To create logger\n\n``` php bin/magento generate:code Module_Name --type=logger [--name=loggerfile]  ```\n\n- To create command\n\n``` php bin/magento generate:code Module_Name --type=command --name=CommandClass --command='test:hello'  ```\n\n- To override/rewrite a class (Block, Model, Controller)\n\n``` php bin/magento generate:code Module_Name --type=rewrite --name=ClassName --rewrite='OverriddenClass' [--path=RelativeToModuleFolder]  ```\n\n- To create email template\n\n``` php bin/magento generate:code Module_Name --type=email --name=\"Email Label\" [--id=\"module_email_test\"] [--template=\"test\"]  ```\n\n- To create Ui Grid Listing\n\n``` php bin/magento generate:code Module_Name --type=ui_component_listing --name=\"test_test\" [--columns_name=\"test_column\"] [--model_class_name=\"Model Class Name\"][--table=\"Table Name\"]   ```\n\n- To create Ui Component Form\n\n``` php bin/magento generate:code Module_Name --type=ui_component_form --name=\"test_test_form\" [--provider_name=\"Data Provider Name\"] [--model_class_name=\"Model Class Name\"] [--fieldset_name=\"Field Set Name\"] [--fieldset_label=\"Field Set Label\"] [--submit_url=\"Form Submit Url\"] [--form_field=\"Form Fields in Json Format\"] ```\n\n```  Ex : form_field = '[{\"field_name\": \"test_input_field\", \"field_type\": \"input\", \"field_label\": \"Test Input Field\", \"is_required\": \"true\"}, {\"field_name\": \"test_image_field\", \"field_type\": \"imageUploader\", \"field_label\": \"Image Uploader\", \"is_required\": \"false\", \"image_upload_url\": \"test/test/upload\"}]' ``` ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebkul%2Fmagento2-code-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebkul%2Fmagento2-code-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebkul%2Fmagento2-code-generator/lists"}