Artisan commands to scaffold Laravel feature structure (make:feature, make:feature-model, make:feature-job, etc.)
mmt/laravel-feature-scaffold is a Laravel package for artisan commands to scaffold laravel feature structure (make:feature, make:feature-model, make:feature-job, etc.).
It currently has 0 GitHub stars and 101 downloads on Packagist (latest version v1.2.0).
Install it with composer require mmt/laravel-feature-scaffold.
Discover more Laravel packages by mmt
or browse all Laravel packages to compare alternatives.
Last updated
Artisan commands to scaffold a feature-based directory structure for Laravel applications, following the pattern used in app/Features/Events.
composer require mmt/laravel-feature-scaffold
This installs the package and its dependency 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
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:
With -f / --files, the command also generates placeholder classes (e.g. EventLog, StoreEventCommand, EventIngestController) that you can customize.
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.
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.
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.
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.
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.
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.
Use the command at the top of this README. No need to register the provider manually.
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:
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/"
}
}
Register the service provider – Add it in bootstrap/providers.php (create the file if it does not exist):
<?php
return [
\MMT\LaravelFeatureScaffold\LaravelFeatureScaffoldServiceProvider::class,
];
Regenerate autoload:
composer dump-autoload
The commands make:feature, make:feature-model, make:feature-job, make:feature-command, make:feature-event, make:feature-listener, and make:feature-service will then be available.
packages/mmt/laravel-feature-scaffold/
├── composer.json
├── README.md
└── src/
├── LaravelFeatureScaffoldServiceProvider.php
├── Exceptions/
│ └── MmtException.php
├── Console/
│ ├── MakeFeatureCommand.php
│ ├── MakeFeatureModelCommand.php
│ ├── MakeFeatureJobCommand.php
│ ├── MakeFeatureArtisanCommand.php
│ ├── MakeFeatureEventCommand.php
│ ├── MakeFeatureListenerCommand.php
│ └── MakeFeatureServiceCommand.php
└── Stubs/
├── console-command.stub
├── event.stub
├── listener.stub
├── service.stub
├── job.stub
├── model.stub
├── repository-contract.stub
├── use-case.stub
├── command.stub
├── request.stub
├── controller.stub
└── enum.stub
MIT