PHPackages                             nosleepman/arch-cli - 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. [CLI &amp; Console](/categories/cli)
4. /
5. nosleepman/arch-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

nosleepman/arch-cli
===================

A Laravel package to generate complete backend architecture from business models

v1.0.15(2w ago)118↓100%MITPHPPHP ^8.1

Since May 13Pushed 2w agoCompare

[ Source](https://github.com/nosleepman1/arch-cli)[ Packagist](https://packagist.org/packages/nosleepman/arch-cli)[ RSS](/packages/nosleepman-arch-cli/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (14)Used By (0)

laravel-arch-cli
================

[](#laravel-arch-cli)

A Laravel Artisan command that scaffolds a complete backend module in one shot — model, migration, service, versioned API controller, form requests, policy, events, listeners, notifications, and API resource.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, 12, or 13

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

[](#installation)

```
composer require nosleepman/laravel-arch-cli
```

Laravel's package auto-discovery registers the service provider automatically. No manual configuration needed.

Usage
-----

[](#usage)

```
php artisan arch:module
```

The command will ask a few questions interactively, then generate everything.

**Example session:**

```
php artisan arch:module Project

Model name [Project]: Project
Enter fields (name:type, press Enter for each, empty line to finish):
  Field: title:string
  Field: description:text:nullable
  Field: status:string
  Field:
Controller version [v1]: v1
Include policies? [yes]: yes
Include events? [no]: yes

```

What gets generated
-------------------

[](#what-gets-generated)

FileLocationModel with `$fillable``app/Models/ProjectModel.php`Migration with columns`database/migrations/..._create_projects_table.php`Service layer`app/Services/ProjectService.php`API Controller`app/Http/Controllers/API/V1/ProjectController.php`Store request`app/Http/Requests/Project/StoreProjectRequest.php`Update request`app/Http/Requests/Project/UpdateProjectRequest.php`Policy`app/Policies/ProjectPolicy.php`Event (if enabled)`app/Events/ProjectCreated.php`Listener (if enabled)`app/Listeners/ProjectCreatedListener.php`Notification (if enabled)`app/Notifications/ProjectCreatedNotification.php`API Resource`app/Http/Resources/ProjectResource.php`Field syntax
------------

[](#field-syntax)

Fields are entered as `name:type` or `name:type:modifier`.

```
title:string
body:text:nullable
price:integer
email:string:unique
is_active:boolean

```

Supported types: `string`, `text`, `integer`, `boolean`, `email`
Supported modifiers: `nullable`, `unique`

The migration columns and form request validation rules are generated from this input automatically.

Architecture overview
---------------------

[](#architecture-overview)

```
src/
├── ArchCLIServiceProvider.php         # Registers the command
├── Console/Commands/
│   └── GenerateModuleCommand.php      # CLI entry point, orchestrates generators
├── Generators/
│   ├── ModelGenerator.php             # Calls make:model, injects $fillable
│   ├── MigrationGenerator.php         # Calls make:migration, injects columns
│   ├── ControllerGenerator.php        # Calls make:controller --api, moves to API/V1/, injects service calls
│   ├── RequestGenerator.php           # Calls make:request ×2, injects validation rules
│   ├── ServiceGenerator.php           # Writes from Service.stub
│   ├── PolicyGenerator.php            # Calls make:policy --model
│   ├── EventGenerator.php             # Writes from Event.stub
│   ├── ListenerGenerator.php          # Writes from Listener.stub
│   ├── NotificationGenerator.php      # Writes from Notification.stub
│   └── ResourceGenerator.php          # Writes from Resource.stub
└── Stubs/
    ├── Service.stub
    ├── Event.stub
    ├── Listener.stub
    ├── Notification.stub
    └── Resource.stub

```

**Two types of generators:**

- *Artisan wrappers* (`Model`, `Migration`, `Controller`, `Request`, `Policy`) — call native Laravel `make:*` commands, then modify the generated file.
- *Stub-based* (`Service`, `Event`, `Listener`, `Notification`, `Resource`) — read a `.stub` template, replace `{{class}}` / `{{model}}` placeholders, and write the result.

After generation
----------------

[](#after-generation)

Register the new routes in your API route file:

```
// routes/api.php
use App\Http\Controllers\API\V1\ProjectController;

Route::apiResource('projects', ProjectController::class);
```

If you enabled policies, register them in `AuthServiceProvider` (Laravel 10) or directly in the controller using `$this->authorizeResource()`.

If you enabled events, register the listener in `EventServiceProvider`:

```
protected $listen = [
    \App\Events\ProjectCreated::class => [
        \App\Listeners\ProjectCreatedListener::class,
    ],
];
```

The generated `ProjectCreatedListener` implements `ShouldQueue` — make sure a queue worker is running, or change the interface if you want synchronous handling.

Known limitations
-----------------

[](#known-limitations)

- Pluralisation is naive (`name . 's'`). Names like `Category` will produce `categorys` in the migration table name. Rename the migration manually in that case.
- The `--full` flag is accepted but currently has no effect — all optional components are already controlled by the interactive prompts.
- The generated service dispatches a `Created` event unconditionally. If you chose not to generate events, remove that line from the service manually.

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

[](#contributing)

1. Fork the repo and create a feature branch.
2. Add or update a generator in `src/Generators/`.
3. If adding a stub-based generator, add the corresponding `.stub` file in `src/Stubs/`.
4. Run the tests: `composer test`

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance96

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

Total

11

Last Release

19d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fbe53c79a975c7ad01a62ee2775883ccdc7c6309621c73e2cf4ac14df507f08?d=identicon)[nosleepman](/maintainers/nosleepman)

---

Top Contributors

[![nosleepman1](https://avatars.githubusercontent.com/u/212015359?v=4)](https://github.com/nosleepman1 "nosleepman1 (34 commits)")

---

Tags

laravelphp8scripting

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nosleepman-arch-cli/health.svg)

```
[![Health](https://phpackages.com/badges/nosleepman-arch-cli/health.svg)](https://phpackages.com/packages/nosleepman-arch-cli)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[ronasit/laravel-entity-generator

Provided console command for generating entities.

2152.5k](/packages/ronasit-laravel-entity-generator)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21313.7k3](/packages/ecotone-laravel)[acdphp/laravel-schedule-police

Stop, start or execute scheduled commands from a simple dashboard without redeploying, while maintaining the visibility, control, and reviewability of the configurations in your codebase.

5121.3k](/packages/acdphp-laravel-schedule-police)

PHPackages © 2026

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