Extends Laravel make:model to also create a service class when using -S flag or --service option.
mattyeend/laravel-model-service is a Laravel package for extends laravel make:model to also create a service class when using -s flag or --service option..
It currently has 1 GitHub stars and 9 downloads on Packagist (latest version v1.1.5).
Install it with composer require mattyeend/laravel-model-service.
Discover more Laravel packages by mattyeend
or browse all Laravel packages to compare alternatives.
Last updated
Extends Laravel's make:model Artisan command to also generate a Service class in app/Services when using the -s (or --service) flag.
make:model optionscomposer require mattyeend/laravel-model-service
Laravel will auto-discover the service provider.
php artisan make:model Post -mcrS
# -> Creates Post model and PostService
php artisan make:model Post --service
# -> Creates PostService
php artisan make:model Post -a
# -> Creates Post model, migration, controller, factory, seeder, policy,
# and now also Postervice
This will create:
app/
Models/
Post.php
Services/
PostService.php
Http/
Controllers/
PostController.php
database/
migrations/
2025_08_15_000000_create_posts_table.php
Flags
-m — Create migration-c — Create controller-r — Resource controller-S/--service — Create serviceYou can publish the stub to modify the generated service file:
php artisan vendor:publish --tag=stubs
This will place stubs/service.stub in your project root.
Modify it to fit your coding standards.
This package is licensed under the MIT License.
Feel free to fork the repository and submit pull requests for improvements or new features!