fatihrizqon/laravel-service-repo-generator
最新稳定版本:v1.0.0
Composer 安装命令:
composer require fatihrizqon/laravel-service-repo-generator
包简介
Artisan command to generate Service & Repository in Laravel
README 文档
README
An Artisan command to generate Service & Repository pattern in Laravel projects, complete with interfaces and customizable stubs.
✨ Features
- Generate Service & Service Interface
- Generate Repository & Repository Interface
- Configurable namespaces
- Customizable stubs via
vendor:publish - Laravel auto-discovery support
- Compatible with Laravel 10, 11, and 12
📦 Installation
Install the package via Composer:
composer require fatihrizqon/laravel-service-repo-generator
The service provider will be automatically registered via Laravel auto-discovery.
⚙️ Publish Configuration
(Optional but recommended)
php artisan vendor:publish --tag=service-repo-generator-config
The configuration file will be published to:
config/service-repo-generator.php
🧱 Publish Stubs (Customize Templates)
To customize the service and repository templates:
php artisan vendor:publish --tag=service-repo-generator-stubs
The stubs will be published to:
stubs/service-repo-generator/
🚀 Usage
Generate a Service
php artisan create:service User
This command will generate:
app/Services/UserService.php
app/Services/Interfaces/IUserService.php
Generate a Repository
php artisan create:repository User
This command will generate:
app/Repositories/UserRepository.php
app/Repositories/Interfaces/IUserRepository.php
🛠 Configuration Example
return [ 'service_namespace' => 'Services', 'service_interface_namespace' => 'Services\\Interfaces', 'repository_namespace' => 'Repositories', 'repository_interface_namespace' => 'Repositories\\Interfaces', ];
📄 License
MIT License © 2025
Created by Fatih Rizqon
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-02