PHPackages                             ahertl/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. [Framework](/categories/framework)
4. /
5. ahertl/laravel-scaffold

ActiveLibrary[Framework](/categories/framework)

ahertl/laravel-scaffold
=======================

A package to scaffold CRUD operations and services for Laravel

v1.2.0(4mo ago)032MITPHPPHP ^8.0

Since Oct 24Pushed 4mo agoCompare

[ Source](https://github.com/AherTechCode/laravel-scaffold)[ Packagist](https://packagist.org/packages/ahertl/laravel-scaffold)[ RSS](/packages/ahertl-laravel-scaffold/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (7)Used By (0)

Laravel Scaffold — Spec-Driven API Scaffolding for Laravel
==========================================================

[](#laravel-scaffold--spec-driven-api-scaffolding-for-laravel)

> Stop rewriting CRUD. Define your backend once, generate everything else.

**Laravel Scaffold** is a developer productivity tool that generates **production-ready Laravel APIs** from either:

- an **existing database**, or
- a **simple human-readable spec file**

It is designed for developers and teams who build **many backends**, not demos.

✅ Used in production
✅ Spec-driven &amp; DB-driven
✅ Clean architecture (Services, Repositories, Requests)
✅ Safe, fast, and extensible

---

Why This Exists
---------------

[](#why-this-exists)

If you’ve built more than a few Laravel applications, you already know the pattern:

- Create models
- Write migrations
- Build repositories
- Add services
- Repeat validation rules
- Repeat again on the next project

This tool exists to **eliminate that repetition**.

Instead of writing structure over and over, you define **intent once**, and let the tool generate consistent, maintainable code.

---

Installation
------------

[](#installation)

```
composer require ahertl/laravel-scaffold
```

---

Two Ways to Use It
------------------

[](#two-ways-to-use-it)

### 1️⃣ Database-First Scaffolding (Legacy or Existing Projects)

[](#1️⃣-database-first-scaffolding-legacy-or-existing-projects)

Generate a full CRUD API directly from an existing table:

```
php artisan laravel:scaffold User --table=users --routes
```

This generates:

- Model
- Repository
- Service
- Controller
- Optional routes

Perfect for:

- legacy systems
- modernizing old databases
- inherited projects

---

### 2️⃣ Spec-Driven Scaffolding (Recommended)

[](#2️⃣-spec-driven-scaffolding-recommended)

Define your backend using a **simple text spec**:

```
user:
- name string required
- email string required unique
- password string hidden

book:
- title string
- isbn string unique
- authorId number

```

Generate everything:

```
php artisan laravel:scaffold --spec=api.spec --migration
```

---

What Gets Generated
-------------------

[](#what-gets-generated)

From a single spec, Laravel Scaffold can generate:

- ✅ Eloquent models (fillable &amp; hidden handled)
- ✅ Services &amp; repositories
- ✅ Controllers
- ✅ Form Request validation classes
- ✅ Database migrations
- ✅ API routes (optional)

You can also generate **only migrations**:

```
php artisan laravel:scaffold --spec=api.spec --migration-only
```

---

Why Spec-Driven?
----------------

[](#why-spec-driven)

Spec-driven development ensures:

- Database schema
- Validation rules
- API structure

…all come from **one source of truth**.

This dramatically reduces:

- bugs
- inconsistencies
- onboarding time

---

Dry-Run Mode (Safe by Default)
------------------------------

[](#dry-run-mode-safe-by-default)

Preview what will be generated **without writing files**:

```
php artisan laravel:scaffold --spec=api.spec --dry-run
```

---

Example Output Structure
------------------------

[](#example-output-structure)

```
app/
 ├── Models/User.php
 ├── Services/UserService.php
 ├── Repositories/UserRepository.php
 ├── Http/
 │   ├── Controllers/UserController.php
 │   └── Requests/
 │       ├── StoreUserRequest.php
 │       └── UpdateUserRequest.php
database/
 └── migrations/

```

---

When This Tool Shines
---------------------

[](#when-this-tool-shines)

Laravel Scaffold is ideal if you:

- Build multiple Laravel backends
- Work on ERP, SaaS, or internal systems
- Want consistent architecture across projects
- Are tired of rewriting CRUD
- Want faster backend delivery without shortcuts

---

Production Use
--------------

[](#production-use)

This tool has been used in **multiple real-world projects** to:

- speed up backend delivery
- standardize API structure
- reduce boilerplate and human error

---

Philosophy
----------

[](#philosophy)

This is **not** a “magic CRUD generator”.

It enforces:

- separation of concerns
- explicit structure
- predictable output

You stay in control — the tool just removes the busy work.

---

Roadmap
-------

[](#roadmap)

Planned improvements include:

- foreign key detection
- richer spec syntax (`string:150`, `default:true`)
- OpenAPI generation
- frontend SDK scaffolding

---

Contributing
------------

[](#contributing)

This project is actively maintained and opinionated by the author.

- Bug reports and feature discussions are welcome via Issues
- Pull requests should be discussed first before implementation
- Architectural changes will be evaluated carefully to maintain consistency

The goal is to keep the tool stable, predictable, and production-ready.

Project Governance
------------------

[](#project-governance)

Laravel Scaffold follows a Benevolent Dictator For Life (BDFL) model. The maintainer retains final decision-making authority to ensure long-term consistency and quality.

---

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance74

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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 ~141 days

Total

4

Last Release

141d ago

### Community

Maintainers

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

---

Top Contributors

[![ahertlcode](https://avatars.githubusercontent.com/u/23422837?v=4)](https://github.com/ahertlcode "ahertlcode (17 commits)")

### Embed Badge

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

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

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[krayin/laravel-crm

Krayin CRM

22.0k32.8k1](/packages/krayin-laravel-crm)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[webreinvent/vaahcms

VaahCMS is a laravel based open-source web application development platform shipped with headless content management system.

5758.2k](/packages/webreinvent-vaahcms)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1225.0k10](/packages/fleetbase-core-api)[fusioncms/cms

Core of FusionCMS

431.1k3](/packages/fusioncms-cms)

PHPackages © 2026

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