jmsr / crud-generator-laravel
Laravel Crud Generator. This Laravel Generator package provides and generate Controller, Model (with eloquent relations) and Views in **Bootstrap** or **React** and by **DDD** architecture, if you want, for your development of your applications with single command.
Fund package maintenance!
awais-vteams
Ko Fi
Requires
- laravel/framework: ^5.5|^6.20.42|^7.0|^8.0|^9.0|^10.0
- laravelcollective/html: ^5.4|^6.0|^7.0|^8.0
This package is auto-updated.
Last update: 2025-04-26 11:12:43 UTC
README
This Laravel Generator package provides and generate Controller, Model (with eloquent relations) and Views in Bootstrap or React and by DDD architecture, if you want, for your development of your applications with single command.
- Will create Model with Eloquent relations
- Will create Controller with all resources
- Will create DDD/Hexagonal Architecture
- Will create UseCases
- Will create Repositories with Interface and custom Exception
- Will create Entities
- Will create views in
Bootstrap
orReact
, yo can choose it in config file - Will create Bindings Routes web and api, and autowiring on
AppProvider
file
Requirements
Laravel >= 8.0
PHP >= 8.1
Installation
- Install
composer require jmsr/crud-generator-laravel --dev
- Publish the default package's config
php artisan vendor:publish --tag=crud
Usage
-
Add
ITEMS_PER_PAGE = 10
to your .env file -
Use these commands
php artisan make:crud {table_name} php artisan make:crud banks
-
Add a route in
web.php
Route::resource('banks', 'BankController');
*Route name in plural slug case.
-
Copy
BaseEntity.stub
file fromvendor/jmsr/src/stubs
to yoursrc
directory and rename it toBaseEntity.php
Options
-
Bootstrap
In this case you don't need to change anything y confi file.
-
Custom Route
php artisan make:crud {table_name} --route={route_name}
-
-
React
You need to change config file
architecture_mode
to ddd andfront
to react-
Do everything under context
php artisan make:crud {table_name} --path={context_name}
-