{"id":14974936,"url":"https://github.com/misterdebug/crud-generator-laravel","last_synced_at":"2025-04-12T22:18:42.450Z","repository":{"id":57020831,"uuid":"73505426","full_name":"misterdebug/crud-generator-laravel","owner":"misterdebug","description":"Create a Laravel 10 CRUD in a few seconds","archived":false,"fork":false,"pushed_at":"2024-01-18T17:41:49.000Z","size":109,"stargazers_count":314,"open_issues_count":1,"forks_count":43,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-12T22:17:57.825Z","etag":null,"topics":["composer-package","crud","crud-generator","generator","laravel","laravel-crud","laravel-crud-generator","laravel-package","laravel10","laravel8","laravel9","rest","rest-api"],"latest_commit_sha":null,"homepage":"","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/misterdebug.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-11T19:28:17.000Z","updated_at":"2025-04-06T08:22:22.000Z","dependencies_parsed_at":"2023-02-12T18:00:30.293Z","dependency_job_id":"279f6349-9549-4bcc-9ee3-a0f5e1226e87","html_url":"https://github.com/misterdebug/crud-generator-laravel","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":"0.030303030303030276","last_synced_commit":"4bffa8a92e52d14cba6dd7a28c5a9bf93bee8e16"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterdebug%2Fcrud-generator-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterdebug%2Fcrud-generator-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterdebug%2Fcrud-generator-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misterdebug%2Fcrud-generator-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/misterdebug","download_url":"https://codeload.github.com/misterdebug/crud-generator-laravel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637786,"owners_count":21137538,"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":["composer-package","crud","crud-generator","generator","laravel","laravel-crud","laravel-crud-generator","laravel-package","laravel10","laravel8","laravel9","rest","rest-api"],"created_at":"2024-09-24T13:51:17.358Z","updated_at":"2025-04-12T22:18:42.407Z","avatar_url":"https://github.com/misterdebug.png","language":"PHP","funding_links":[],"categories":["Development"],"sub_categories":["Generator"],"readme":"# Crud Generator Laravel 9 and 10 (your time saver)\n\nCrud Generator Laravel is a package that you can integrate in your Laravel to create a REAL CRUD. It includes :\n\n- **Controller** with all the code already written\n- **Views** (index, create, edit, show)\n- **Model** with relationships\n- **Request** file with validation rules\n- **Migration** file\n\nAnd since 1.9.2, a complete **REST API** !\n\n[ NEW ] [Your voice matters! Participate in the polls and vote for future features and improvements](https://github.com/misterdebug/crud-generator-laravel/discussions/categories/polls)\n\nIf you find this project useful, please consider giving it a star⭐. It helps me prioritize and focus on keeping project up-to-date. Thank you for your support!\n\n\n## Installation\n\n1\\. Run the following composer command:\n\n``` composer require mrdebug/crudgen --dev ```\n\n2\\. If you don't use Laravel Collective Form package in your project, install it:\n\n``` composer require laravelcollective/html ```\n\n\u003csub\u003e(Note: This step is not required if you don't need views.)\u003c/sub\u003e\n\n3\\. Publish the configuration file, stubs and the default-theme directory for views:\n\n``` php artisan vendor:publish --provider=\"Mrdebug\\Crudgen\\CrudgenServiceProvider\" ```\n\n\n## Usage\n\n### Create CRUD (or REST API)\n\nLet's illustrate with a real life example : Building a blog\n\nA `Post` has many (hasMany) `Comment` and belongs to many (belongsToMany) `Tag`\n\nA `Post` can have a `title` and a `content` fields\n\nLet's do this 🙂\n\n\u003csub\u003eIf you need a REST API instead of CRUD, [read this wiki](https://github.com/misterdebug/crud-generator-laravel/wiki/Make-a-complete-REST-API-instead-of-CRUD)\u003c/sub\u003e\n\n#### CRUD generator command :\n\n``` php artisan make:crud nameOfYourCrud \"column1:type, column2\" ``` (theory)\n\n``` php artisan make:crud post \"title:string, content:text\" ``` (for our example)\n\n\u003csub\u003e[Available options](https://github.com/misterdebug/crud-generator-laravel/wiki/Available-options-when-you-use-make:crud-command)\u003c/sub\u003e\n\n\u003csub\u003e[Generate CRUD with livewire datatable](https://github.com/misterdebug/crud-generator-laravel/wiki/Generate-CRUD-with-livewire-datatable)\u003c/sub\u003e\n\nWhen you call this command, the controller, views and request are generated with your fields (in this case, title and content).\n![image](https://user-images.githubusercontent.com/23297600/192172786-1703f7b8-f577-45c1-b0f9-296999827af2.png)\n\nNow let's add our relationships (`Comment` and `Tag` models) :\n\n![image](https://user-images.githubusercontent.com/23297600/192173041-6c71d727-1e29-4edc-9397-bdb07f44a378.png)\n\nWe add a `hasMany` relationship between our `Post` and `Comment`\nand a `belongsToMany` with `Tag`\n\nTwo migrations are created (`create_posts` AND `create_post_tag`).\n\n`create_posts` is your table for your `Post` model\n\n`create_post_tag` is a pivot table to handle the `belongsToMany` relationship\n\n`Post` model is generated too with both relationships added\n\n![image](https://user-images.githubusercontent.com/23297600/192173463-f3e61b41-373a-44a8-870f-fc837968a5c7.png)\n\n### Migration\n\nBoth migration files are created in your **database/migrations** directory. If necessary edit them and run :\n   \n``` php artisan migrate ```\n\n### Controller\n\nA controller file is created in your **app/Http/Controllers** directory. All methods (index, create, store, show, edit, update, destroy) are filled with your fields.\n\n### Routes\n\nTo create your routes for this new controller, you can do this :\n\n``` Route::resource('posts', PostsController::class); ``` \u003csub\u003e\u003csup\u003e(don't forget to import your `PostsController` in your `web.php` file)\u003c/sup\u003e\u003c/sub\u003e\n\n##### Screenshots\n\n`/posts/create` :\n![image](https://user-images.githubusercontent.com/23297600/192176702-dc0371f4-5d1b-49e3-a9ea-7352a33187d4.png)\n\n\n`/posts` :\n![image](https://user-images.githubusercontent.com/23297600/192176845-b3722083-90a9-4257-90d1-8a2eb28baa01.png)\n\nYou can `edit` and `delete` your new post. And a `show` page is created too 🙂\n\n### Request\n\nA request file is created in your **app/Http/Requests** directory. By default, all fields are required, you can edit it according to your needs.\n\n### Views\n\nA views directory is created in your **resources/views** directory.\n\u003csub\u003eIf you want to customize generated views : [https://github.com/misterdebug/crud-generator-laravel/wiki/Custom-your-views](https://github.com/misterdebug/crud-generator-laravel/wiki/Custom-your-views)\u003c/sub\u003e\n\nYou can create views independently of the CRUD generator with :\n``` php artisan make:views nameOfYourDirectoryViews \"column1:type, column2\" ```\n\n## Finish your blog\n\nAdd your `Comment` CRUD (with a column `comment` and a `post_id`)\n\n``` php artisan make:crud comment \"comment:text, post_id:integer\" ```\n\nAdd your `Tag` CRUD (with a `column` name)\n\n``` php artisan make:crud tag \"name\" ```\n\nFYI : `Comment` is a specific case and you can use `make:commentable` command\n\u003csmall\u003e[Docs about commentable](https://github.com/misterdebug/crud-generator-laravel/wiki/Add-a-commentable-structure-to-any-model)\u003c/small\u003e\n\nFinished 🎉\n\n## Remove a CRUD\n\nYou can delete all files (except migrations) created by the `make:crud` command at any time. No need to remove files manually :\n\n``` php artisan rm:crud nameOfYourCrud --force ```\n\n``` php artisan rm:crud post --force ``` (in our example)\n\nThe `--force` flag (optional) deletes all files without confirmation\n\n![image](https://user-images.githubusercontent.com/23297600/192183601-a4f8d206-3920-4f8a-8e0d-cf8442894e07.png)\n\n\n## License\n\nThis package is licensed under the [license MIT](http://opensource.org/licenses/MIT).\n\n## Other Projects\n\nExplore my other projects on GitHub:\n\n- **[LaraFileEncrypter](https://github.com/misterdebug/laravel-file-encrypter)**: Secure your files in Laravel with AES-256 encryption, without persistent key storage hassle.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisterdebug%2Fcrud-generator-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisterdebug%2Fcrud-generator-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisterdebug%2Fcrud-generator-laravel/lists"}