ferdinalaxewall/service-repository-generator
最新稳定版本:1.1.2
Composer 安装命令:
composer require ferdinalaxewall/service-repository-generator
包简介
Laravel Service and Repository Generator Package
README 文档
README
Laravel Service Repository Generator
Laravel Service Repository Generator is a Package for Generating Service and Repository Class based on Model or custom name
Installation Guide
composer require ferdinalaxewall/service-repository-generator
Go to config/app.php, then put these code on service providers
'providers' => [ /* * Package Service Providers... */ \Ferdinalaxewall\ServiceRepositoryGenerator\ServiceRepositoryGeneratorProvider::class, ],
Last, for make sure this package installed correctly.
composer dump-autoload && php artisan optimize:clear
Default Service Repository Directory Structure Based
├── app | ├── Services | | ├── Entity | | | ├── EntityService.php | | | ├── EntityServiceImp.php | ├── Repositories | | ├── Entity | | | ├── EntityRepository.php | | | ├── EntityRepositoryImp.php | | └── BaseRepository.php
Usage Guide
Generate Service Repository Class with Interface
Generate Service and Repository Class with construct the Model and Create Base Repository Class
php artisan make:service-repository {model}
Generate Service Only Class with Interface
Generate Service Class
php artisan make:service {service-name}
Generate Repository Only Class with Interface
- Generate Repository Class with construct the Model and Create Base Repository Class
php artisan make:repository {repository-name} {--model=}
OR
- Generate Repository Class without construct the Model
php artisan make:repository {repository-name}
Features
- Generate Service and Repository Class with Implement Interface
- Generate Only Service Class with Implement Interface
- Generate Only Repository Class with Implement Interface
- Automaticaly Generate Base Repository Class
- Support Nesting Service, Repository Classpath (e.g. Master/User, Master/User/Employee, etc)
- Automaticaly Generate Model (If the model didn't exists) when Create Repository Class
- Automaticaly Class and Interface Binding (Only File inside Services or Repositories Directory)
Contributors
License
This project is released under the MIT license.
统计信息
- 总下载量: 52
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-09