This Laravel CRUD Generator v2.x package provides and generates Controller, Model (with eloquent relations), and Views in Bootstrap/Tailwind CSS for the development of your applications with a single command. This new v2.x
will have stack options like bootstrap
, tailwind
, livewire
(Livewire views will be generated in Tailwind CSS), and API
only.
- Will create Model with Eloquent relations
- 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.
Laravel >= 10.x
PHP >= 8.1
1 - Install
composer require ibex/crud-generator --dev
2- Publish the default package's config (optional)
php artisan vendor:publish --tag=crud
For older Laravel(<10.x) versions please use v1.x
composer require ibex/crud-generator:1.6 --dev
php artisan make:crud {table_name}
php artisan make:crud banks
Add a route in web.php
Route::resource('banks', BankController::class);
For Livewire
add routes below
Route::get('/banks', \App\Livewire\Banks\Index::class)->name('banks.index');
Route::get('/banks/create', \App\Livewire\Banks\Create::class)->name('banks.create');
Route::get('/banks/show/{bank}', \App\Livewire\Banks\Show::class)->name('banks.show');
Route::get('/banks/update/{bank}', \App\Livewire\Banks\Edit::class)->name('banks.edit');
For api
add routes below
Route::apiResource('banks', BankController::class);
Route name in plural slug case.
php artisan make:crud {table_name} {bootstrap,tailwind,livewire,api}
php artisan make:crud banks bootstrap //This will create views in Bootstrap 5 using Blade
php artisan make:crud banks tailwind //This will create views in Tailwind css using Blade
php artisan make:crud banks livewire //This will create views in Tailwind css with Livewire components
php artisan make:crud banks api //This will create API only controllers
- Custom Route
php artisan make:crud {table_name} --route={route_name}
API only controller
![image](https://private-user-images.githubusercontent.com/10154558/324219434-a42329a8-58e7-49ef-8e21-b6227555542b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwNDU0MDMsIm5iZiI6MTcyMDA0NTEwMywicGF0aCI6Ii8xMDE1NDU1OC8zMjQyMTk0MzQtYTQyMzI5YTgtNThlNy00OWVmLThlMjEtYjYyMjc1NTU1NDJiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAzVDIyMTgyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ4Mzc1OWYxNDUyNzM5NjJiNzMyOTZlZjhiNTFiNzM3N2Q5Y2M2M2QyODlmZmJlYzhlYWVlNTBkNzMyNWY0YzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.oyMDbb_pQswIxHw8-JftbvRbw_4a9866yELCNjSP-Rg)
Tailwind Form
![image](https://private-user-images.githubusercontent.com/10154558/319566749-b7d437ac-5d2b-4673-80ab-c2f7eb88e835.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwNDU0MDMsIm5iZiI6MTcyMDA0NTEwMywicGF0aCI6Ii8xMDE1NDU1OC8zMTk1NjY3NDktYjdkNDM3YWMtNWQyYi00NjczLTgwYWItYzJmN2ViODhlODM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAzVDIyMTgyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA0Y2Y5ZGMwMDM2MWU4NzBkZDIzYWQ1ODk4NjFhN2MzYWI0M2U1ZDdkMzc3MGRhNDU1MjViYTA4YWM4OWUyYmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.W1YObnu-J5e01D__CzJBMoSukdG3tHg3WMT76AwCXtE)
M Awais // Email Me
Hire Me LinkedIn