PHPackages                             mosweed/laravel-auto-crud - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mosweed/laravel-auto-crud

ActiveLibrary[API Development](/categories/api)

mosweed/laravel-auto-crud
=========================

Complete CRUD scaffolding generator for Laravel 12 with API, Blade views, Livewire components, automatic routing, custom layouts, and more

v1.0.3(4mo ago)026MITPHPPHP ^8.2CI passing

Since Jan 1Pushed 4mo agoCompare

[ Source](https://github.com/Mosweed/laravel-auto-crud)[ Packagist](https://packagist.org/packages/mosweed/laravel-auto-crud)[ Docs](https://github.com/Mosweed/laravel-auto-crud)[ GitHub Sponsors](https://github.com/Mosweed)[ RSS](/packages/mosweed-laravel-auto-crud/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

[![Laravel Auto CRUD](https://camo.githubusercontent.com/60178bb256cd44288e915ce1571a5c890a01322ad8bbc0eaff6c88923cf865ca/68747470733a2f2f6175746f637275642e6d6f686d616479617a616e73776565642e6e6c2f6c6f676f2e706e67)](https://camo.githubusercontent.com/60178bb256cd44288e915ce1571a5c890a01322ad8bbc0eaff6c88923cf865ca/68747470733a2f2f6175746f637275642e6d6f686d616479617a616e73776565642e6e6c2f6c6f676f2e706e67)Laravel Auto CRUD
=================

[](#laravel-auto-crud)

**Generate complete CRUD scaffolding in seconds**

[![Website](https://camo.githubusercontent.com/67b7f1a76d3df08730d0ad24e46d8ad55088b48a1d5af0e0c0830ae531d4bf6d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576562736974652d6175746f637275642e6d6f686d616479617a616e73776565642e6e6c2d6f72616e67653f7374796c653d666f722d7468652d6261646765)](https://autocrud.mohmadyazansweed.nl)

[![Tests](https://camo.githubusercontent.com/37f7b94c050a2afc71fad3b6ac71beef53381e46cc3b64403d24204f0d30cf2d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4d6f73776565642f6c61726176656c2d6175746f2d637275642f74657374732e796d6c3f7374796c653d666c61742d737175617265266c6162656c3d7465737473)](https://github.com/Mosweed/laravel-auto-crud/actions/workflows/tests.yml)[![Latest Version](https://camo.githubusercontent.com/b5295f6b7df701e691c5794f3eb9da6682faf60aea0d9b2f6aca34466af8319a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f73776565642f6c61726176656c2d6175746f2d637275642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mosweed/laravel-auto-crud)[![Downloads](https://camo.githubusercontent.com/42037ab63a2f7ce3ffde533d4e5bc3af414b7611803d42e9f2a2bd795868dd32/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f73776565642f6c61726176656c2d6175746f2d637275642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mosweed/laravel-auto-crud)[![License](https://camo.githubusercontent.com/1f0433c255890c77201e907000013dea7535060207a5d7d89ce67c87ab398a1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6f73776565642f6c61726176656c2d6175746f2d637275642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mosweed/laravel-auto-crud)[![Stars](https://camo.githubusercontent.com/8d19bd90cf952e8f44a26f2988b7b510086306c5e69461e790e9991e6ecf02db/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f4d6f73776565642f6c61726176656c2d6175746f2d637275642e7376673f7374796c653d666c61742d737175617265)](https://github.com/Mosweed/laravel-auto-crud)

[Installation](#-installation) • [Quick Start](#-quick-start) • [Features](#-features) • [Documentation](DOCUMENTATION.md)

---

⚡ Features
----------

[](#-features)

FeatureDescription🏗️ **Complete CRUD**Models, Controllers, Views, Routes in one command🌐 **API &amp; Web**Generate API and Web controllers simultaneously🎨 **Modern Views**Tailwind v4 &amp; Bootstrap 5 with dark mode⚡ **Livewire**Real-time table and form components🛣️ **Auto Routing**Routes automatically added to your files🏠 **App Layout**Ready-to-use layout with navigation🎯 **Tailwind v4**Auto-detects and configures CSS variables🗑️ **Soft Deletes**Full restore/force-delete support🔍 **Filter &amp; Sort**Built-in query traits🧪 **Tests**Automatic Pest/PHPUnit generation📋 **JSON Config**Batch generate multiple CRUDs↩️ **Rollback**Auto cleanup on errors---

📋 Requirements
--------------

[](#-requirements)

- PHP 8.2+
- Laravel 11.x or 12.x

---

📦 Installation
--------------

[](#-installation)

```
composer require mosweed/laravel-auto-crud
```

### Publish Layout &amp; Welcome Page

[](#publish-layout--welcome-page)

```
php artisan crud:layout --welcome
```

### Publish Configuration (Optional)

[](#publish-configuration-optional)

```
php artisan vendor:publish --tag=auto-crud-config
```

---

🚀 Quick Start
-------------

[](#-quick-start)

```
# 1. Publish layout and welcome page
php artisan crud:layout --welcome

# 2. Generate a complete CRUD
php artisan make:crud Product \
    --fields="name:string,price:decimal,description:text:nullable" \
    --belongsTo=Category \
    --all \
    --add-to-nav

# 3. Run migrations
php artisan migrate

# 4. Build assets
npm run build
```

Your CRUD is ready at `/products` ✨

---

💻 Usage
-------

[](#-usage)

### Basic Command

[](#basic-command)

```
php artisan make:crud Post
```

This generates:

- ✅ Model with Filterable and Sortable traits
- ✅ Web Controller
- ✅ API Controller
- ✅ Form Requests (Store &amp; Update)
- ✅ Policy
- ✅ Blade Views (index, create, edit, show)
- ✅ Routes in `web.php` and `api.php`

### Command Options

[](#command-options)

OptionDescription`--type=api|web|both`Output type (default: both)`--css=tailwind|bootstrap`CSS framework (default: tailwind)`--all`Generate migration, factory, seeder, and tests`--force`Overwrite existing files`--soft-deletes`Add soft delete support`--livewire`Generate Livewire components`--tests`Generate feature and unit tests`--fields=...`Define fields inline`--belongsTo=Model`Add belongsTo relationship`--hasMany=Model`Add hasMany relationship`--belongsToMany=Model`Add belongsToMany relationship`--json=path`Generate from JSON configuration`--add-to-nav`Add to navigation menu### Defining Fields

[](#defining-fields)

```
php artisan make:crud Post --fields="title:string,body:text,is_published:boolean"
```

#### Supported Types

[](#supported-types)

TypeDatabase Column`string`VARCHAR`text`TEXT`integer`INTEGER`boolean`BOOLEAN`date`DATE`datetime`DATETIME`decimal`DECIMAL`json`JSON`foreignId`BIGINT UNSIGNED#### Modifiers

[](#modifiers)

```
--fields="title:string:255,slug:string:unique,body:text:nullable"
```

- `nullable` - Field can be null
- `unique` - Add unique constraint
- `255` - String length

### Relationships

[](#relationships)

```
# BelongsTo
php artisan make:crud Post --belongsTo=User --belongsTo=Category

# HasMany
php artisan make:crud User --hasMany=Post

# BelongsToMany
php artisan make:crud Post --belongsToMany=Tag
```

### JSON Configuration

[](#json-configuration)

Create a `crud.json` file:

```
{
    "models": [
        {
            "name": "Product",
            "fields": [
                {"name": "name", "type": "string"},
                {"name": "price", "type": "decimal"}
            ],
            "relationships": [
                {"type": "belongsTo", "model": "Category"}
            ]
        }
    ],
    "options": {
        "all": true,
        "softDeletes": true
    }
}
```

Run:

```
php artisan make:crud --json=crud.json
```

---

🏠 Layout Command
----------------

[](#-layout-command)

```
php artisan crud:layout
```

OptionDescription`--css=bootstrap`Use Bootstrap instead of Tailwind`--force`Overwrite existing layout`--welcome`Also publish welcome/dashboard page`--models=Product`Pre-populate navigation### Welcome Page

[](#welcome-page)

```
# Layout + welcome page together
php artisan crud:layout --welcome

# With Bootstrap
php artisan crud:layout --css=bootstrap --welcome
```

---

🔍 Filtering &amp; Sorting
-------------------------

[](#-filtering--sorting)

The generated models include `Filterable` and `Sortable` traits:

```
// Filter
GET /products?status=active
GET /products?price_from=10&price_to=100
GET /products?search=keyword

// Sort
GET /products?sort=name&direction=asc

// Soft Deletes
GET /products?trashed=1
```

---

🎨 Tailwind v4 Colors
--------------------

[](#-tailwind-v4-colors)

Laravel 12 uses Tailwind v4 by default. Edit `resources/css/app.css`:

```
@theme {
    /* Primary - Change to green */
    --color-primary-500: #22c55e;
    --color-primary-600: #16a34a;
    --color-primary-700: #15803d;

    /* Secondary */
    --color-secondary-500: #6366f1;
    --color-secondary-600: #4f46e5;
}
```

---

📁 Generated Files
-----------------

[](#-generated-files)

```
app/
├── Http/Controllers/
│   ├── ProductController.php
│   └── Api/ProductController.php
├── Http/Requests/Product/
│   ├── StoreProductRequest.php
│   └── UpdateProductRequest.php
├── Models/Product.php
└── Policies/ProductPolicy.php

database/
├── factories/ProductFactory.php
├── migrations/xxxx_create_products_table.php
└── seeders/ProductSeeder.php

resources/views/
├── components/app-layout.blade.php
├── welcome.blade.php
└── products/
    ├── index.blade.php
    ├── create.blade.php
    ├── edit.blade.php
    └── show.blade.php

```

---

📖 Documentation
---------------

[](#-documentation)

For complete documentation, see [DOCUMENTATION.md](DOCUMENTATION.md).

---

🧪 Testing
---------

[](#-testing)

```
composer test
```

---

📝 Changelog
-----------

[](#-changelog)

See [CHANGELOG.md](CHANGELOG.md) for recent changes.

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

---

🔒 Security
----------

[](#-security)

If you discover any security-related issues, please open an issue on GitHub.

---

👨‍💻 Credits
-----------

[](#‍-credits)

- [Mosweed](https://github.com/Mosweed)

---

📄 License
---------

[](#-license)

The MIT License (MIT). See [LICENSE](LICENSE) for more information.

---

**[⬆ Back to Top](#laravel-auto-crud)**

Made with ⚡ by [Mosweed](https://github.com/Mosweed)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance76

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

132d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e6db9db9cec7f66ef910e89aaec120afa72d493b29e60546d1706c6493936de0?d=identicon)[mo\_sweed](/maintainers/mo_sweed)

---

Top Contributors

[![Mosweed](https://avatars.githubusercontent.com/u/74544214?v=4)](https://github.com/Mosweed "Mosweed (6 commits)")

---

Tags

automationcrudgeneratorlaravellaravel-packagephpapilaravelscaffoldinggeneratorartisanlivewiretailwindresourcecrudbootstrapadmin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mosweed-laravel-auto-crud/health.svg)

```
[![Health](https://phpackages.com/badges/mosweed-laravel-auto-crud/health.svg)](https://phpackages.com/packages/mosweed-laravel-auto-crud)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
