darshan-belani/laravel-crud-generator
最新稳定版本:v1.0.0
Composer 安装命令:
composer require darshan-belani/laravel-crud-generator
包简介
Laravel CRUD Generator
关键字:
README 文档
README
This Laravel CRUD Generator package streamlines development by generating Migration, Controllers, Models (with Eloquent relationships), and Views using a single command. It supports multiple frontend stacks, including Bootstrap, Tailwind CSS, and Livewire (Livewire views use Tailwind CSS). You can also choose an API-only stack for backend-focused applications.
- Will create Model with Eloquent relations
- Will create Migration with table name anf fillable attribute
- Will create Controller with all resources
- Will create API Controllers with all requests
- Will create Component with all resources for Livewire
- Will create views in Bootstrap/Tailwind
This is the best crud generator for a blank Laravel project installation too. This will auto install the starter kit laravel/breeze or laravel/ui (for bootstrap 5) for blank Laravel installation.
Requirements
Laravel >= 10.x
PHP >= 8.1
Installation
1 - Install
composer require darshan-belani/laravel-crud-generator
2- Publish the default package's config (optional)
php artisan vendor:publish --tag=crud
Usage
When creating a blog module, please ensure that the table name is set as either blogs or posts.
php artisan make:module {table_name}
php artisan make:module posts
Enter table name
Tech Stack
Enter the number for how many fields required (number only)
Enter fields name
After that those below files is created
File examples
Created a route in web.php
Route::resource('blogs', BlogController::class);
For Livewire created routes below
Route::get('/posts', \App\Livewire\Posts\Index::class)->name('posts.index');
Route::get('/posts/create', \App\Livewire\Posts\Create::class)->name('posts.create');
Route::get('/posts/show/{bank}', \App\Livewire\Posts\Show::class)->name('posts.show');
Route::get('/posts/update/{bank}', \App\Livewire\Posts\Edit::class)->name('posts.edit');
For api created routes below
Route::apiResource('blogs', BlogController::class);
Route name in plural slug case.
php artisan make:module {table_name} {bootstrap,tailwind,livewire,api}
php artisan make:module blogs bootstrap //This will create views in Bootstrap 5 using Blade
php artisan make:module blogs tailwind //This will create views in Tailwind css using Blade
php artisan make:module blogs livewire //This will create views in Tailwind css with Livewire components
php artisan make:module blogs api //This will create API only controllers
Custom Route
php artisan make:module {table_name} --route={route_name}
File Examples
Model structure
Controller structure
Livewire component
API only controller
Tailwind CSS
Tailwind Form
Bootstrap
Bootstrap Form
Personalize
You have the possibility of 100% customizing the generated views, this is achieved in the following way:
- Run this command
php artisan vendor:publish --tag=crudthis will create thecrud.phpfile in your config/ folder. - Update the variable
stub_path, to your own stub folder like'stub_path' => resource_path('stubs/'), - Copy the stubs files from package
php artisan vendor:publish --tag=stubs-crud
- Update your changes in your stub files. (you can delete extra files/folders if you are not using them).
- Run the command for crud generation and you'll get the updated views.
Author
Darshan Belani // Email Me
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-05













