定制 khaledweka/repository-generator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱: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.

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固