PHPackages                             joesu/laravel-scaffold - 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. joesu/laravel-scaffold

ActiveLibrary[API Development](/categories/api)

joesu/laravel-scaffold
======================

A powerful Laravel package that provides a complete implementation of Repository and Service patterns for rapid API development.

v1.1.3(1y ago)31142[1 PRs](https://github.com/su860421/laravel-scaffold/pulls)MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Jun 27Pushed 11mo agoCompare

[ Source](https://github.com/su860421/laravel-scaffold)[ Packagist](https://packagist.org/packages/joesu/laravel-scaffold)[ Docs](https://github.com/joesu/laravel-scaffold)[ RSS](/packages/joesu-laravel-scaffold/feed)WikiDiscussions master Synced today

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

🚀 Laravel Scaffold - Enterprise-Grade CRUD Generator
====================================================

[](#-laravel-scaffold---enterprise-grade-crud-generator)

> **From 0 to Complete API in 30 Seconds** - Auto-generate Repository, Service, Controller with Laravel best practices

[![PHP Version](https://camo.githubusercontent.com/7535257ca228724c93658bd52583d4e47a9bab02c356abf6e54c1d575f2151e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75652e737667)](https://php.net)[![Laravel Version](https://camo.githubusercontent.com/80f0f752f7b9e72bd9ddd4e6d7c13e85efac621a058ff679bd9384561f9bbebb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e7825323025374325323031312e7825323025374325323031322e782d677265656e2e737667)](https://laravel.com)[![License](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)[![Tests](https://camo.githubusercontent.com/3e5c58346fdf51e69f9b04f69e54d7fcdf9abb5b0bec88d687a4853ef02e1538/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54657374732d50617373696e672d627269676874677265656e2e737667)](https://github.com/su860421/laravel-scaffold)

**Solve the Problem**: Eliminate repetitive CRUD code and implement enterprise-grade architecture patterns in Laravel development.

🎯 Why Choose Laravel Scaffold?
------------------------------

[](#-why-choose-laravel-scaffold)

FeatureLaravel ScaffoldOther Packages**Repository Pattern**✅ Complete implementation❌ Basic only**Service Layer**✅ Business logic separation❌ Missing**Auto Setup**✅ Routes &amp; bindings❌ Manual setup**Multilingual Support**✅ Built-in EN/CN❌ English only**Advanced Features**✅ Filtering, sorting, batch ops❌ Limited**Clean Architecture**✅ Interface contracts❌ Direct coupling🚀 Quick Start
-------------

[](#-quick-start)

```
# Install the package
composer require joesu/laravel-scaffold

# Generate complete CRUD architecture
php artisan make:repository User

# That's it! Your API is ready to use
```

**30 seconds later, you have a complete User API with enterprise architecture!**

🎯 Perfect For
-------------

[](#-perfect-for)

- ✅ **Enterprise API Development** - Production-ready architecture
- ✅ **SaaS Backend Systems** - Scalable service layer
- ✅ **Rapid Prototyping** - Quick MVP development
- ✅ **Team Collaboration** - Consistent code patterns
- ✅ **Code Quality** - Clean architecture patterns

🏗️ Architecture
---------------

[](#️-architecture)

Laravel Scaffold provides a complete layered architecture with enterprise-grade patterns:

### Base Classes

[](#base-classes)

- **BaseRepository**: Full CRUD implementation with advanced features
- **BaseService**: Business logic layer with batch operations

### Generated Structure

[](#generated-structure)

When you run `php artisan make:repository User`, you get:

```
app/
├── Models/
│   └── User.php                    # Eloquent Model
├── Http/
│   ├── Controllers/
│   │   └── UserController.php      # API Controller
│   └── Requests/
│       └── User/                   # Request validation classes
│           ├── StoreUserRequest.php    # Store validation
│           ├── UpdateUserRequest.php   # Update validation
│           ├── IndexUserRequest.php    # Index validation
│           └── ShowUserRequest.php     # Show validation
├── Repositories/
│   └── UserRepository.php          # Extends BaseRepository
├── Services/
│   └── UserService.php             # Extends BaseService
└── Contracts/
    ├── UserRepositoryInterface.php # Repository contract
    └── UserServiceInterface.php    # Service contract

```

**Automatic Setup:**

- ✅ **Service Provider Bindings**: Automatically added to `AppServiceProvider`
- ✅ **API Routes**: Automatically added to `routes/api.php`
- ✅ **Dependency Injection**: Ready to use with Laravel's DI container

✨ Key Features
--------------

[](#-key-features)

### 🔄 Advanced Repository Features

[](#-advanced-repository-features)

- **Complete CRUD operations** with error handling
- **Advanced query methods** with relationship loading
- **Smart filtering system** (JSON and array formats)
- **Relationship field filtering** (e.g., 'user.name')
- **Configurable sorting** with whitelist protection
- **Batch operations** (create, update, delete)
- **Soft delete support** with restore functionality
- **Multilingual error messages** (EN/CN)

### 🎛️ Service Layer Features

[](#️-service-layer-features)

- **Business logic encapsulation**
- **Batch operations** with transaction support
- **Utility methods** (updateOrCreate, exists, count)
- **Soft delete operations**
- **Error handling** with custom exceptions

🛠️ Installation &amp; Setup
---------------------------

[](#️-installation--setup)

### 1. Install Package

[](#1-install-package)

```
composer require joesu/laravel-scaffold
```

### 2. Publish Configuration (Optional)

[](#2-publish-configuration-optional)

```
php artisan vendor:publish --provider="JoeSu\LaravelScaffold\Providers\LaravelScaffoldServiceProvider"
```

### 3. Generate Your First CRUD

[](#3-generate-your-first-crud)

```
# Complete CRUD generation with automatic setup
php artisan make:repository User

# Include migration file
php artisan make:repository User --migration

# Include request validation classes
php artisan make:repository User --requests

# Include both migration and requests
php artisan make:repository User --migration --requests

# Force overwrite existing files
php artisan make:repository User --force
```

**What happens automatically:**

- ✅ Model is always created (needed for Repository and Service)
- ✅ Service provider bindings are added to `AppServiceProvider`
- ✅ API routes are added to `routes/api.php`
- ✅ All files are properly namespaced and ready to use
- ✅ No manual configuration required

**Available Options:**

- `--migration`: Create migration file
- `--requests`: Create request validation classes
- `--force`: Overwrite existing files

🌍 Multilingual Support
----------------------

[](#-multilingual-support)

Built-in support for multiple languages with automatic error message translation:

### Supported Languages

[](#supported-languages)

- 🇺🇸 English (en)
- 🇹🇼 Chinese Traditional (zh-TW)

### Publishing Language Files

[](#publishing-language-files)

```
# Publish all language files
php artisan vendor:publish --provider="JoeSu\LaravelScaffold\Providers\LaravelScaffoldServiceProvider" --tag=lang
```

### Error Message Examples

[](#error-message-examples)

```
// English
"Record with ID 123 not found"
"Failed to create model: SQLSTATE[23000]: Integrity constraint violation"

// Chinese Traditional (when locale is zh-TW)
"找不到 ID 為 123 的記錄"
"建立模型失敗: SQLSTATE[23000]: Integrity constraint violation"
```

🔧 Configuration
---------------

[](#-configuration)

The package automatically registers service providers and bindings. For custom configuration:

```
# Publish config file
php artisan vendor:publish --provider="JoeSu\LaravelScaffold\Providers\LaravelScaffoldServiceProvider"
```

🧪 Testing
---------

[](#-testing)

```
# Run package tests
composer test

# Run with coverage
composer test-coverage
```

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

[](#-requirements)

- **PHP**: ^8.1|^8.2|^8.3|^8.4
- **Laravel**: ^10.0|^11.0|^12.0

🔄 Version Compatibility
-----------------------

[](#-version-compatibility)

Laravel VersionPHP VersionStatus10.x^8.1✅ Supported11.x^8.2✅ Supported12.x^8.2✅ SupportedFor detailed version compatibility, see [VERSION\_COMPATIBILITY.md](VERSION_COMPATIBILITY.md).

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

[](#-contributing)

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT License](LICENSE).

🆘 Support
---------

[](#-support)

- 📧 **Issues**: [GitHub Issues](https://github.com/su860421/laravel-scaffold/issues)
- 📚 **Documentation**: [GitHub Wiki](https://github.com/su860421/laravel-scaffold/wiki)
- 💬 **Discussions**: [GitHub Discussions](https://github.com/su860421/laravel-scaffold/discussions)

⭐ Show Your Support
-------------------

[](#-show-your-support)

If this package helps you, please give it a ⭐ on GitHub!

---

**Built with ❤️ for the Laravel community**

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance50

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

5

Last Release

370d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c05c33882d0f68207b73e394b90d8829a2d0e90ab7eab56ad553ee612b8b030?d=identicon)[su860421](/maintainers/su860421)

---

Top Contributors

[![su860421](https://avatars.githubusercontent.com/u/58799340?v=4)](https://github.com/su860421 "su860421 (8 commits)")

---

Tags

apilaravelgeneratorscaffoldservicearchitectureboilerplaterepositorypattern

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/joesu-laravel-scaffold/health.svg)

```
[![Health](https://phpackages.com/badges/joesu-laravel-scaffold/health.svg)](https://phpackages.com/packages/joesu-laravel-scaffold)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

3.0k37.6M134](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k14.2M63](/packages/knuckleswtf-scribe)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[specialtactics/laravel-api-boilerplate

An API boilerplate for Laravel

5461.5k](/packages/specialtactics-laravel-api-boilerplate)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.8k](/packages/scriptdevelop-whatsapp-manager)[yxx/laravel-quick

agile development

145.6k](/packages/yxx-laravel-quick)

PHPackages © 2026

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