Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Laravel CRUD Generator

License

NotificationsYou must be signed in to change notification settings

awais-vteams/laravel-crud-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Crud Generator

PackagistLicenceStyleCI

This Laravel CRUD Generator v2.x package provides and generates Controller, Model (with eloquent relations), and Views inBootstrap/Tailwind CSS for the development of your applications with a single command. This newv2.x will have stack options likebootstrap,tailwind,livewire(Livewire views will be generated inTailwind CSS), andAPI only.

  • Will createModel with Eloquent relations
  • Will createController with all resources
  • Will createAPI Controllers with all requests
  • Will createComponent with all resources for Livewire
  • Will createviews in Bootstrap/Tailwind

This is the best crud generator for a blank Laravel project installation too. This will auto install the starter kitlaravel/breeze orlaravel/ui (for bootstrap 5) for blank Laravel installation.

Requirements

Laravel >= 10.xPHP >= 8.1

Installation

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 usev1.x

composer require ibex/crud-generator:1.6 --dev

Usage

php artisan make:crud {table_name}php artisan make:crud banks

Add a route inweb.php

Route::resource('banks', BankController::class);

ForLivewire 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');

Forapi add routes below

Route::apiResource('banks', BankController::class);

Route name in plural slug case.

Options

  • Tech Stack

    image
php artisan make:crud {table_name} {bootstrap,tailwind,livewire,api}php artisan make:crud banks bootstrap  //This will create views in Bootstrap 5 using Bladephp artisan make:crud banks tailwind   //This will create views in Tailwind css using Bladephp artisan make:crud banks livewire   //This will create views in Tailwind css with Livewire componentsphp artisan make:crud banks api        //This will create API only controllers
  • Custom Route
php artisan make:crud {table_name} --route={route_name}

Examples

Modelimage

Controllerimage

Livewire componentimage

API only controller

image

Tailwind CSSimage

BootstrapListing

Tailwind Form

image

Bootstrap FormForm

Personalize

You have the possibility of 100% customizing the generated views, this is achieved in the following way:

  • Run this commandphp artisan vendor:publish --tag=crud this will create thecrud.php file in your config/ folder.
  • Update the variablestub_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

M Awais //Email Me

Hire MeLinkedIn

Buy me a Coffee

ko-fi


[8]ページ先頭

©2009-2025 Movatter.jp