PHPackages                             sndpbag/crud-generator - 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. [Framework](/categories/framework)
4. /
5. sndpbag/crud-generator

ActiveLibrary[Framework](/categories/framework)

sndpbag/crud-generator
======================

A powerful Laravel CRUD generator package with advanced features

1.0.0(5mo ago)02MITPHPPHP ^8.1

Since Nov 22Pushed 5mo agoCompare

[ Source](https://github.com/sndpbag/laravel-crud-generator-packege)[ Packagist](https://packagist.org/packages/sndpbag/crud-generator)[ RSS](/packages/sndpbag-crud-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

"# CRUD Generator"

🚀 Laravel CRUD Generator
========================

[](#-laravel-crud-generator)

 [![Latest Version](https://camo.githubusercontent.com/a59d936d3a4d6e153f9ac70d4bd3fe5b162b9bc86c4328e54fc16249aa7f0ef3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736e64706261672f637275642d67656e657261746f722e737667)](https://camo.githubusercontent.com/a59d936d3a4d6e153f9ac70d4bd3fe5b162b9bc86c4328e54fc16249aa7f0ef3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736e64706261672f637275642d67656e657261746f722e737667) [![Total Downloads](https://camo.githubusercontent.com/d27679d079b257002dd030f3e7098ca00eea03f5200421f5096ec40eb4331685/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736e64706261672f637275642d67656e657261746f722e737667)](https://camo.githubusercontent.com/d27679d079b257002dd030f3e7098ca00eea03f5200421f5096ec40eb4331685/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736e64706261672f637275642d67656e657261746f722e737667) [![License](https://camo.githubusercontent.com/c68964d0c4870da33ab39f141ef6d9903dd39c1beb48f345120ca903e5917426/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736e64706261672f637275642d67656e657261746f722e737667)](https://camo.githubusercontent.com/c68964d0c4870da33ab39f141ef6d9903dd39c1beb48f345120ca903e5917426/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736e64706261672f637275642d67656e657261746f722e737667) [![Stars](https://camo.githubusercontent.com/32fc2006fcb74ee02d24437d2daad2fa7dddcf06b3abebb0c1cf4886dffecba1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f736e64706261672f637275642d67656e657261746f722e737667)](https://camo.githubusercontent.com/32fc2006fcb74ee02d24437d2daad2fa7dddcf06b3abebb0c1cf4886dffecba1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f736e64706261672f637275642d67656e657261746f722e737667)

 **Generate complete Laravel CRUD in seconds with a single command!**

 [Features](#-features) • [Installation](#-installation) • [Quick Start](#-quick-start) • [Documentation](#-documentation) • [Contributing](#-contributing)

---

🎯 Why This Package?
-------------------

[](#-why-this-package)

Stop wasting time writing repetitive CRUD code! This package generates:

- ✅ Model with relationships
- ✅ Migration with all field types
- ✅ Controller with complete CRUD logic
- ✅ Form Request validation classes
- ✅ Beautiful responsive views (Bootstrap/Tailwind)
- ✅ Automatic route registration
- ✅ Feature tests
- ✅ And much more...

**All in just 5 seconds!** ⚡

---

✨ Features
----------

[](#-features)

### 🎨 Smart Generation

[](#-smart-generation)

- **26 Advanced Features**
- Smart field type detection
- Enum fields with dropdowns
- File &amp; image uploads
- Relationship scaffolding

### 🔧 Developer Friendly

[](#-developer-friendly)

- Customizable stubs
- Bootstrap &amp; Tailwind support
- API mode (JSON responses)
- Authentication support
- ✅ **Email Notification (Mailable + Job) support**

### 🧪 Testing Ready

[](#-testing-ready)

- PHPUnit test generation
- Pest test support
- Complete test coverage
- TDD workflow

### 📦 Production Ready

[](#-production-ready)

- Namespaced generation
- Soft deletes
- Search &amp; sorting
- Pagination

---

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

[](#-installation)

```
composer require sndpbag/crud-generator
```

That's it! No configuration needed. Start generating CRUDs immediately.

---

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

[](#-quick-start)

### Basic Example

[](#basic-example)

```
php artisan make:crud Product --fields="name:string,price:integer,description:text"
```

**Generated files in 5 seconds:**

- ✅ `app/Models/Product.php`
- ✅ `database/migrations/..._create_products_table.php`
- ✅ `app/Http/Controllers/ProductController.php`
- ✅ `app/Http/Requests/StoreProductRequest.php`
- ✅ `app/Http/Requests/UpdateProductRequest.php`
- ✅ `resources/views/products/*.blade.php`
- ✅ Routes in `routes/web.php`

Run migration and you're done:

```
php artisan migrate
```

Visit: `http://localhost/products` 🎉

---

💡 Advanced Usage
----------------

[](#-advanced-usage)

### E-commerce Product CRUD

[](#e-commerce-product-crud)

```
php artisan make:crud Product \
  --fields="name:string:unique,slug:string:unique,price:decimal:default(0),stock:integer,image:image:nullable,status:enum(active,inactive):default('active'),is_featured:boolean:default(0)" \
  --belongsTo=Category \
  --belongsTo=Brand \
  --softdelete \
  --auth \
  --tests
```

### Admin Panel

[](#admin-panel)

```
php artisan make:crud Admin/Post \
  --fields="title:string:unique,content:text,featured_image:image:nullable" \
  --belongsTo=User \
  --belongsTo=Category \
  --auth
```

### API Endpoints

[](#api-endpoints)

```
php artisan make:crud Product --fields="name:string,price:integer" --api
```

---

### 📧 ইমেল নোটিফিকেশন সহ CRUD

[](#-ইমেল-নোটিফিকেশন-সহ-crud)

আপনি যদি চান যে নতুন কোনো ডেটা তৈরি (create) হওয়ার সাথে সাথে একটি ইমেল নোটিফিকেশন পাঠানো হোক, তবে `--email` ফ্ল্যাগটি ব্যবহার করুন।

```
php artisan make:crud Order --fields="item_name:string,price:integer" --belongsTo=User --email

এটি স্বয়ংক্রিয়ভাবে তৈরি করবে:

✅ app/Mail/OrderCreatedMailable.php (ShouldQueue সহ)

✅ app/Jobs/SendOrderCreatedEmailJob.php

✅ resources/views/emails/order.blade.php (Markdown টেমপ্লেট)

✅ OrderController-এর store মেথডে জব ডিসপ্যাচ করার কোড।

---

## 🎨 Field Types

| Type | HTML | Example |
|------|------|---------|
| string | `` | `name:string` |
| text | `` | `description:text` |
| integer | `` | `age:integer` |
| decimal | `` | `price:decimal` |
| boolean | `` | `is_active:boolean` |
| date | `` | `birth_date:date` |
| datetime | `` | `published_at:datetime` |
| email | `` | `email:email` |
| file | `` | `document:file` |
| image | `` | `photo:image` |
| enum | `` | `status:enum(active,inactive)` |

---

## 🔧 Modifiers

```bash
# Nullable field
--fields="description:text:nullable"

# Unique constraint
--fields="email:email:unique"

# Default value
--fields="status:enum(active,inactive):default('active')"

# Combine modifiers
--fields="slug:string:unique:nullable"
```

---

🔗 Relationships
---------------

[](#-relationships)

```
# BelongsTo (generates dropdown in forms)
--belongsTo=User --belongsTo=Category

# HasMany
--hasMany=Comment --hasMany=Review
```

---

🎯 Command Flags
---------------

[](#-command-flags)

FlagDescriptionExample`--fields`Define fields`--fields="name:string,price:integer"``--belongsTo`Add belongsTo relationship`--belongsTo=User``--hasMany`Add hasMany relationship`--hasMany=Comment``--softdelete`Enable soft deletes`--softdelete``--auth`Add auth middleware`--auth``--api`Generate API instead of web`--api``--tests`Generate PHPUnit tests`--tests``--pest`Generate Pest tests`--pest``--email`নতুন রেকর্ড তৈরি হলে ইমেল পাঠানোর জন্য Mailable ও Job তৈরি করে`--email`---

🗑️ Rollback
-----------

[](#️-rollback)

Delete all generated files:

```
php artisan crud:delete Product
```

---

📚 Documentation
---------------

[](#-documentation)

- [📖 Complete Documentation](README.md)
- [⚡ Quick Start Guide](QUICK_START.md)
- [🔧 Installation Guide](INSTALLATION.md)
- [💡 Real-World Examples](EXAMPLES.md)
- [🤝 Contributing Guidelines](CONTRIBUTING.md)

---

🎥 Video Tutorial
----------------

[](#-video-tutorial)

Coming soon! Subscribe to our YouTube channel.

---

📊 Comparison
------------

[](#-comparison)

FeatureManual CodingThis PackageTime Required~2 hours5 secondsModel✋ Manual✅ AutoMigration✋ Manual✅ AutoController✋ Manual✅ AutoValidation✋ Manual✅ AutoViews✋ Manual✅ AutoRoutes✋ Manual✅ AutoTests✋ Manual✅ AutoFile Uploads✋ Manual✅ AutoRelationships✋ Manual✅ Auto---

🌟 Real-World Examples
---------------------

[](#-real-world-examples)

### Blog System

[](#blog-system)

```
php artisan make:crud Post --fields="title:string:unique,content:text,status:enum(draft,published)" --belongsTo=User --hasMany=Comment --softdelete --auth --tests
```

### Inventory Management

[](#inventory-management)

```
php artisan make:crud Product --fields="sku:string:unique,name:string,stock:integer,price:decimal" --belongsTo=Category --belongsTo=Supplier --auth
```

### Booking System

[](#booking-system)

```
php artisan make:crud Appointment --fields="appointment_date:datetime,status:enum(pending,confirmed,cancelled)" --belongsTo=User --belongsTo=Service --auth
```

See more in [EXAMPLES.md](EXAMPLES.md)

---

⚙️ Configuration
----------------

[](#️-configuration)

Publish config file:

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

Customize in `config/crud-generator.php`:

```
return [
    'template' => 'bootstrap', // or 'tailwind'
    'storage_path' => 'public/uploads',
    'pagination' => 10,
    'alert_library' => 'sweetalert2',
];

আপনি `config/crud-generator.php` ফাইলে ডিফল্ট ভ্যালু পরিবর্তন করতে পারেন।

প্রথমে কনফিগ ফাইলটি পাবলিশ করুন:
```bash
php artisan vendor:publish --tag=crud-generator-config

📧 ইমেল নোটিফিকেশন সেটআপ (Email Notification Setup)
--email ফ্ল্যাগটি ব্যবহার করার জন্য আপনাকে দুটি জিনিস সেট করতে হবে:

১. অ্যাডমিন ইমেল সেট করুন: JobGenerator স্বয়ংক্রিয়ভাবে মডেলে email ফিল্ড খুঁজে বের করার চেষ্টা করে। যদি না পায়, তবে এটি config/crud-generator.php ফাইলে থাকা admin_email ব্যবহার করে।

আপনার .env ফাইলে অ্যাডমিন ইমেল যোগ করুন:

ADMIN_EMAIL="your_admin_email@example.com"

২. Queue Worker চালু করুন: ইমেলগুলো যেন ইউজার এক্সপেরিয়েন্স নষ্ট না করে, সেজন্য এগুলো Queue-এর মাধ্যমে পাঠানো হয় (ShouldQueue)। তাই আপনাকে অবশ্যই একটি Queue Worker চালু রাখতে হবে:

php artisan queue:work
```

---

🎨 Customize Templates
---------------------

[](#-customize-templates)

Publish stubs:

```
php artisan vendor:publish --tag=crud-generator-stubs
```

Edit files in `stubs/crud-generator/` to customize generated code.

---

🧪 Testing
---------

[](#-testing)

Run package tests:

```
composer test
```

Generate tests for your CRUD:

```
php artisan make:crud Product --fields="name:string" --tests
php artisan test
```

---

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

[](#-contributing)

We love contributions! Please read our [Contributing Guide](CONTRIBUTING.md).

### Contributors

[](#contributors)

[ ![](https://camo.githubusercontent.com/69ba0f0041a94680ef0e10b49ba998a23f3b60631792459d202751b8dbdb1216/68747470733a2f2f636f6e747269622e726f636b732f696d6167653f7265706f3d736e64706261672f637275642d67656e657261746f72)](https://github.com/sndpbag/crud-generator/graphs/contributors)---

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

[](#-changelog)

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

---

🐛 Issues
--------

[](#-issues)

Found a bug? [Open an issue](https://github.com/sndpbag/crud-generator/issues)

---

💬 Discussions
-------------

[](#-discussions)

Have questions? [Start a discussion](https://github.com/sndpbag/crud-generator/discussions)

---

⭐ Star History
--------------

[](#-star-history)

[![Star History Chart](https://camo.githubusercontent.com/dcb84d1c770a4d457b5c1197333f1aa3d009248575f6ed07ef5a83b8123e74be/68747470733a2f2f6170692e737461722d686973746f72792e636f6d2f7376673f7265706f733d736e64706261672f637275642d67656e657261746f7226747970653d44617465)](https://star-history.com/#sndpbag/crud-generator&Date)

---

📄 License
---------

[](#-license)

The MIT License (MIT). See [LICENSE](LICENSE) for details.

---

💝 Support
---------

[](#-support)

If you find this package helpful, please consider:

- ⭐ Starring the repository
- 🐛 Reporting bugs
- 💡 Suggesting features
- 📖 Improving documentation
- ☕ [Buy me a coffee](https://buymeacoffee.com/yourname)

---

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

- Laravel Community
- All Contributors
- Open Source Community

---

 **Made with ❤️ for the Laravel Community**

 Built by [sandipan kr bag](https://github.com/sndpbag)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance70

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

Unknown

Total

1

Last Release

169d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b559afd1382982cdcdc6b7588f096b239dd0d397d0f82dfff939b59d97229a23?d=identicon)[sndpbag](/maintainers/sndpbag)

---

Top Contributors

[![sndpbag](https://avatars.githubusercontent.com/u/142666414?v=4)](https://github.com/sndpbag "sndpbag (37 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sndpbag-crud-generator/health.svg)

```
[![Health](https://phpackages.com/badges/sndpbag-crud-generator/health.svg)](https://phpackages.com/packages/sndpbag-crud-generator)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M672](/packages/laravel-socialite)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M224](/packages/laravel-horizon)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M597](/packages/laravel-ui)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[stancl/tenancy

Automatic multi-tenancy for your Laravel application.

4.3k6.6M40](/packages/stancl-tenancy)[internachi/modular

Modularize your Laravel apps

1.1k662.4k8](/packages/internachi-modular)

PHPackages © 2026

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