{"id":14974545,"url":"https://github.com/laragen/laragen","last_synced_at":"2025-10-08T21:25:11.313Z","repository":{"id":57011481,"uuid":"84286341","full_name":"laragen/laragen","owner":"laragen","description":"A Generator for Laravel 5","archived":false,"fork":false,"pushed_at":"2017-03-15T09:26:59.000Z","size":25,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T04:31:41.356Z","etag":null,"topics":["artisan-command","code-generator-laravel","eloquent-models","laravel54","model-generator"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laragen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-08T06:26:00.000Z","updated_at":"2021-03-29T02:15:26.000Z","dependencies_parsed_at":"2022-08-21T13:10:19.793Z","dependency_job_id":null,"html_url":"https://github.com/laragen/laragen","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laragen%2Flaragen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laragen%2Flaragen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laragen%2Flaragen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laragen%2Flaragen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laragen","download_url":"https://codeload.github.com/laragen/laragen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238471967,"owners_count":19478138,"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":["artisan-command","code-generator-laravel","eloquent-models","laravel54","model-generator"],"created_at":"2024-09-24T13:50:43.252Z","updated_at":"2025-10-08T21:25:11.221Z","avatar_url":"https://github.com/laragen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laragen\n#### A powerful yet lightweight generator for Laravel 5.4  and php7\n\n### Installation\n1. Install via composer.\n\n    ```bash\n    composer require laragen/laragen --dev\n    ```\n    \n1. Add `LaragenServiceProvider` to `app/Providers/AppServiceProvider.php`.\n\n    ```php\n    if ($this-\u003eapp-\u003eenvironment('local')) {    \n        $this-\u003eapp-\u003eregister(\\Laragen\\Laragen\\LaragenServiceProvider::class);\n    }\n    ```\n    \n1. Publish config files.\n\n     ```bash\n     php artisan vendor:publish --tag=laragen.config\n     ```\n     \n### Quick Look\n    ```bash\n    php artisan laragen:model User\n    php artisan laragen:model --all\n    \n    php artisan laragen:api User\n    php artisan laragen:api User --model --actions=index,view\n    \n    php artisan laragen:channel Sms\n    php artisan laragen:channel Sms --message=mobile,content\n    php artisan laragen:message Sms\n    php artisan laragen:message Sms --attributes=mobie,content\n    ```\n    \n### Config\n  \n  ```php\n  return [\n      'model' =\u003e [\n          'path' =\u003e 'Models', // path after `app/`\n          'soft_delete' =\u003e true, //add deleted_at for $dates\n          'traits' =\u003e [], // traits for model\n          'parent_class' =\u003e 'Illuminate\\Database\\Eloquent\\Model',\n          'ignore_admin_tables' =\u003e true, //ignore admin tables generated by laravel-admin plugin\n          'ignore_tables' =\u003e ['jobs', 'migrations', 'notifications'], //ignore system tables\n          'morph_many' =\u003e [ //see https://laravel.com/docs/5.4/eloquent-relationships# polymorphic-relations\n              'Comment' =\u003e ['News', 'Post'],\n              'Like' =\u003e ['News', 'Post'],\n          ],\n  \n      ],\n      'api' =\u003e [\n          'path' =\u003e 'Api', // path after `app/Controllers/`\n          'version' =\u003e 1, // real path is `app/Controllers/{path}/V{version}`\n          'parent_class' =\u003e 'App\\Http\\Controllers\\Controller',\n      ],\n  ];\n  ```\n  \n### Sample Output\n\n1. Generate Eloquent Model Class.\n    ```php\n    \u003c?php\n    namespace App\\Models;\n    \n    use Illuminate\\Database\\Eloquent\\Model;\n    use Illuminate\\Database\\Eloquent\\Relations\\BelongsTo;\n    use Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany;\n    use Illuminate\\Database\\Eloquent\\Relations\\HasMany;\n    use Illuminate\\Database\\Eloquent\\Relations\\MorphMany;\n    use Illuminate\\Database\\Eloquent\\Relations\\MorphTo;\n    use Illuminate\\Database\\Eloquent\\SoftDeletes;\n    use Illuminate\\Notifications\\Notifiable;\n    \n    class Comment extends Model\n    {\n        use SoftDeletes;\n    \n        public $fillable = ['user_id', 'content', 'commentable_id', 'commentable_type'];\n    \n        public $casts = [];\n    \n        public $appends = [];\n    \n        public $dates = ['deleted_at'];\n    \n    \n        /**\n         * Get user\n         * @return BelongsTo\n         */\n        public function user(): BelongsTo\n        {\n            return $this-\u003ebelongsTo(User::class);\n        }\n    \n    \n        /**\n         * Get commentable model\n         * @return MorphTo\n         */\n        public function commentable(): MorphTo\n        {\n            return $this-\u003emorphTo();\n        }\n    \n    }\n    ```\n  \n## Any issue or pull request is appreciated :)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaragen%2Flaragen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaragen%2Flaragen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaragen%2Flaragen/lists"}