khaledweka/repository-generator
最新稳定版本:v1.2
Composer 安装命令:
composer require khaledweka/repository-generator
包简介
A Laravel package to generate repository pattern files based on models
README 文档
README
A Laravel package to generate repository pattern files based on your models.
Installation
- Install the package via composer:
composer require khaledweka/repository-generator
Publish the configuration file (optional):
php artisan vendor:publish --provider="khaledweka\RepositoryGenerator\RepositoryGeneratorServiceProvider"
Usage Generate repository files for a specific model:
php artisan make:repository User
Generate repository files for all models:
php artisan make:repository --all
Features Generates contract interfaces for repositories
Generates repository classes that extend BaseRepository
Automatically updates the RepositoryServiceProvider
Follows your existing repository pattern implementation
How to Use
- Install the package in your Laravel project
- Run the command to generate repositories:
- For a specific model:
php artisan make:repository User - For all models:
php artisan make:repository --all
- For a specific model:
- The package will generate:
- Contract interface in
app/Repositories/Contracts/ - Repository class in
app/Repositories/SQL/ - Update the
RepositoryServiceProvider
- Contract interface in
Key Features
- Follows your existing repository pattern implementation
- Generates proper type hints and method signatures
- Automatically binds contracts to implementations in the service provider
- Supports generating repositories for all models at once
- Maintains your existing base repository structure
The package will save you significant time when implementing the repository pattern in your Laravel applications by automating the boilerplate code generation.
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-22