khaledweka/repository-generator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. 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

  1. Install the package in your Laravel project
  2. Run the command to generate repositories:
    • For a specific model: php artisan make:repository User
    • For all models: php artisan make:repository --all
  3. The package will generate:
    • Contract interface in app/Repositories/Contracts/
    • Repository class in app/Repositories/SQL/
    • Update the RepositoryServiceProvider

Key Features

  1. Follows your existing repository pattern implementation
  2. Generates proper type hints and method signatures
  3. Automatically binds contracts to implementations in the service provider
  4. Supports generating repositories for all models at once
  5. 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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-22