Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Crud Generator Laravel Package

darshan-belani/laravel-crud-generator

Generate full Laravel CRUD modules from one command: migrations, models with relationships, resource/API controllers, Livewire components, and Bootstrap/Tailwind views. Can auto-install Breeze or Laravel UI on fresh apps. Supports Laravel 10+, PHP 8.1+.

View on GitHub
Deep Wiki
Context7

model_1

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

createTable.png

Tech Stack

img.png

Enter the number for how many fields required (number only)

field_number.png

Enter fields name

enter_field_name.png

After that those below files is created

create_files.png

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

model

Controller structure

controller

Livewire component

live_wire

API only controller

api_controller

Tailwind CSS

Listing

Tailwind Form

tailwind_from

Bootstrap

Listing

Bootstrap Form

bootstrap_from

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=crud this will create the crud.php file 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

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
directorytree/privacy-filter-classifier
directorytree/privacy-filter
babenkoivan/elastic-client
innmind/static-analysis
innmind/coding-standard
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit