zintel / laravel-service
This package helps you create a service and bind a model to it
1.0.3
2025-03-27 06:05 UTC
Requires
- php: ^7.1|^8.1
README
A Laravel Artisan command to generate service classes following the Model-View-Controller-Service (MVCS) pattern, promoting separation of business logic from controllers.
Features
- 🚀 Quick service class generation
- 📁 Supports nested directory structure
- 🔗 Optional model binding
- 🛠️ Pre-configured CRUD method stubs
- ⚡ Laravel 9.x and 10.x compatible
Installation
- Install via Composer:
composer require zintel/laravel-service
- The package will auto-register. For manual registration, add to config/app.php:
'providers' => [ // ... \Zintel\LaravelService\Providers\MakeServiceCommandProvider::class, ],
- Basic Command
php artisan make:service ServiceName --m=ModelName
- With Model Binding
php artisan make:service ServiceName --m=ModelName
5Nested Services
php artisan make:service Folder/ServiceName