Download the PHP package lowel/laravel-service-maker without Composer
On this page you can find all versions of the php package lowel/laravel-service-maker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lowel/laravel-service-maker
More information about lowel/laravel-service-maker
Files in lowel/laravel-service-maker
Package laravel-service-maker
Short Description A package for Laravel 9+ that helps generate layered services according to the Interface-Service-Factory pattern using laravel's built-in DI.
License MIT
Homepage https://github.com/l0w3l/laravel-service-maker
Informations about the package laravel-service-maker
Laravel Service/Repository Generator Package
This Laravel package provides Artisan commands to quickly generate service and repository classes with their corresponding interfaces and factories following a standardized structure.
Installation
-
Install the package via Composer:
- The package will automatically register its service provider. If you need to publish the configuration file:
Commands
Create a new service
Options:
name: The name of the service (e.g.,Paymentwill createPaymentService)--s|singleton: Create the service as a singleton
Example:
This will generate:
App/Services/Payment/PaymentService.phpApp/Services/Payment/PaymentServiceInterface.phpApp/Services/Payment/PaymentServiceFactory.php
Create a new repository
Options:
name: The name of the repository (e.g.,Userwill createUserRepository)--s|singleton: Create the repository as a singleton
Example:
This will generate:
App/Repositories/User/UserRepository.phpApp/Repositories/User/UserRepositoryInterface.phpApp/Repositories/User/UserRepositoryFactory.php
File Structure
The package follows this directory structure:
Usage
After generating the classes, you can use them through Laravel's dependency injection:
The package automatically registers the interfaces in Laravel's container, binding them to their concrete implementations.
Configuration
You can customize the generation behavior by publishing and modifying the package configuration file:
This will create config/service-maker.php where you can configure:
- Base paths
- Class mapping
- Formatting
Requirements
- PHP 8.3+
- Laravel 9+
License
This package is open-sourced software licensed under the MIT license.
All versions of laravel-service-maker with dependencies
composer/class-map-generator Version *
illuminate/contracts Version ^10.0||^11.0||^12.0|^13.0
spatie/laravel-package-tools Version ^1.16