PHPackages                             mmt/laravel-feature-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mmt/laravel-feature-scaffold

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mmt/laravel-feature-scaffold
============================

Artisan commands to scaffold Laravel feature structure (make:feature, make:feature-model, make:feature-job, etc.)

v1.2.0(1mo ago)020↓50%MITPHPPHP ^8.2

Since Feb 25Pushed 1mo agoCompare

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

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

MMT Laravel Feature Scaffold
============================

[](#mmt-laravel-feature-scaffold)

Artisan commands to scaffold a feature-based directory structure for Laravel applications, following the pattern used in `app/Features/Events`.

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

[](#installation)

```
composer require mmt/laravel-feature-scaffold
```

This installs the package and its dependency [mmt/api-response-normalizer](https://packagist.org/packages/mmt/api-response-normalizer). Generated controllers use the `ApiResponse` trait for consistent JSON responses. Laravel auto-discovers the service provider; the Artisan commands are available after `composer install` or `composer update`.

To upgrade to the latest version:

```
composer update mmt/laravel-feature-scaffold
```

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

[](#requirements)

- PHP ^8.2
- Laravel ^11.0 or ^12.0
- Illuminate Support ^11.0 or ^12.0

Commands
--------

[](#commands)

### make:feature

[](#makefeature)

Creates the directory structure for a new feature under `app/Features/{Name}/`.

**Usage:**

```
# Create only the directory structure
php artisan make:feature Events

# Create directories and generate stub files (model, repository contract, use case, command, request, controller, enum)
php artisan make:feature Events -f
# or
php artisan make:feature Events --files
```

**Directories created:**

- Console
- Enums
- Events
- Factories
- Http/V1/Commands
- Http/V1/Controllers
- Http/V1/Requests
- Jobs
- Listeners
- Models
- Repositories/Contracts
- Services
- UseCases

With `-f` / `--files`, the command also generates placeholder classes (e.g. `EventLog`, `StoreEventCommand`, `EventIngestController`) that you can customize.

### make:feature-model

[](#makefeature-model)

Creates an Eloquent model inside an existing feature.

**Usage:**

```
php artisan make:feature-model Event/EventLog
php artisan make:feature-model Events/NotificationLog
```

The feature (e.g. `Event` or `Events`) must already exist. The model is created at `app/Features/{Feature}/Models/{ModelName}.php`.

### make:feature-job

[](#makefeature-job)

Creates a queued job class inside an existing feature. If the feature does not have `Jobs`, `Events`, or `Listeners` directories, they are created.

**Usage:**

```
php artisan make:feature-job Messaging/ProcessJourneyStep
php artisan make:feature-job Events/SendEventNotification
```

The job is created at `app/Features/{Feature}/Jobs/{JobName}.php` and implements `ShouldQueue` with the `Queueable` trait.

### make:feature-command

[](#makefeature-command)

Creates an Artisan console command inside an existing feature (`Features/FeatureName/Console`). The command signature is generated as `{feature-kebab}:{command-kebab}` (e.g. `Messaging/ProcessJourneyStep` → `messaging:process-journey-step`).

**Usage:**

```
php artisan make:feature-command Messaging/ProcessJourneyStep
php artisan make:feature-command Events/SendDigest
```

The class is created at `app/Features/{Feature}/Console/{CommandName}.php`. Register the feature's `Console` directory in your app (e.g. `bootstrap/app.php` or a service provider) so Laravel loads these commands.

### make:feature-event

[](#makefeature-event)

Creates an event class inside an existing feature (`Features/FeatureName/Events`).

**Usage:**

```
php artisan make:feature-event Messaging/JourneyCompleted
php artisan make:feature-event Events/EventRecorded
```

The event is created at `app/Features/{Feature}/Events/{EventName}.php` with `Dispatchable` and `SerializesModels`.

### make:feature-listener

[](#makefeature-listener)

Creates a queued event listener inside an existing feature (`Features/FeatureName/Listeners`).

**Usage:**

```
php artisan make:feature-listener Messaging/SendJourneyNotification
php artisan make:feature-listener Events/LogEvent
```

The listener is created at `app/Features/{Feature}/Listeners/{ListenerName}.php`, implements `ShouldQueue`, and has a `handle(object $event)` method.

### make:feature-service

[](#makefeature-service)

Creates a service class inside an existing feature (`Features/FeatureName/Services`).

**Usage:**

```
php artisan make:feature-service Messaging/SegmentEvaluatorService
php artisan make:feature-service Events/EventIngestService
```

The service is created at `app/Features/{Feature}/Services/{ServiceName}.php` as a plain class in the `Services` namespace.

Installation options
--------------------

[](#installation-options)

### Via Packagist (recommended)

[](#via-packagist-recommended)

Use the command at the top of this README. No need to register the provider manually.

### Local / development (PSR-4 only)

[](#local--development-psr-4-only)

If you use the package from a local path (e.g. `packages/mmt/laravel-feature-scaffold`) without adding it as a Composer dependency, auto-discovery does not run. You must:

1. **Autoload** – In your Laravel project `composer.json`, add the package path to `autoload.psr-4`:

    ```
    "autoload": {
        "psr-4": {
            "MMT\\LaravelFeatureScaffold\\": "packages/mmt/laravel-feature-scaffold/src/"
        }
    }
    ```
2. **Register the service provider** – Add it in `bootstrap/providers.php` (create the file if it does not exist):

    ```
