定制 amroboney/repository-generator 二次开发

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

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

amroboney/repository-generator

Composer 安装命令:

composer require amroboney/repository-generator

包简介

A feature-rich Laravel package to simplify and streamline the process of generating repository files using the repository pattern, promoting clean architecture and maintainable code.

README 文档

README

A Laravel package designed to streamline the implementation of the repository pattern in your projects. This tool generates a complete repository setup, including repository classes, interfaces, and service classes, helping developers maintain clean, organized, and decoupled codebases. This package is ideal for teams and individuals following Clean Architecture and Domain-Driven Design (DDD) principles, enabling faster scaffolding of repositories and services for Laravel applications.

📦 Installation

You can install the package via Composer:

composer require amroboney/repository-generator

If the package is not on Packagist and hosted on GitHub, add this to your Laravel app’s composer.json:

"repositories": [
  {
    "type": "vcs",
    "url": "https://github.com/amroboney/repository-generator"
  }
]

Then install it with:

composer require amroboney/repository-generator:dev-main

⚙️ Usage

Generate a repository, interface, and service using the artisan command:

php artisan make:repository ModelName

This will generate the following files automatically:

app/
├── Repositories
│    └── Interfaces/
│    │   └── ModelNameRepositoryInterface.php
│    └── Repositories/
│       └── ModelNameRepository.php
└── Services/
  └── ModelNameService.php

You only need to replace ModelName with the relevant name for your feature or entity (e.g., User).

🌟 Features

  • Automated File Generation: Instantly creates repository and service structures, saving significant development time.
  • Repository Pattern Support: Promotes clear separation of concerns between business logic and database operations in Laravel.
  • Configurable Structure: Adheres to Clean Architecture and Domain-Driven Design principles.
  • PHP 8.1+ Compatibility: Leverages modern PHP syntax and features for robust development.

📂 File Structure Example

If you run the command php artisan make:repository User, this is how your file structure will look:

app/
├── Repositories/
│   ├── Interfaces/
│   │   └── UserRepositoryInterface.php
│   └── Implementations/
│       └── UserRepository.php
└── Services/
    └── UserService.php
  • UserRepositoryInterface.php: Defines the contract for the repository.
  • UserRepository.php: Implements the repository logic for interacting with the database.
  • UserService.php: Contains business logic and operations for the User entity.

🤝 Contributing

Contributions are welcome! If you'd like to contribute to this package, feel free to fork the repository and submit a pull request. Please ensure that your code adheres to PSR standards and includes thorough testing.

🧑‍💻 Author

Amro Boney 📧 amroboney@gmail.com 📍 Riyadh, Saudi Arabia

License Information

This package is licensed under the MIT License, which means:

✅ Permissions:

  • Commercial Use You can use this package in commercial applications and products.
  • Modification You are allowed to modify the source code for your own use.
  • Distribution You can freely share, distribute, or resell the package (as-is or modified).
  • Private Use You can use this package in private or internal projects without any restrictions.

❌ Limitations:

  • No Liability The author is not responsible for any damages resulting from the use of this software.
  • No Warranty The software is provided "as is," without any warranty of any kind (express or implied), including but not limited to:
    • Warranties of merchantability.
    • Fitness for a particular purpose.
    • Non-infringement.

For full license details, please refer to the LICENSE file included in this repository.

amroboney/repository-generator 适用场景与选型建议

amroboney/repository-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 131 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 05 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 amroboney/repository-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 amroboney/repository-generator 我们能提供哪些服务?
定制开发 / 二次开发

基于 amroboney/repository-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-05-12