shakib53626/laravel-repository-maker
Composer 安装命令:
composer require shakib53626/laravel-repository-maker
包简介
The shakib53626/laravel-repository-maker package provides a simple and efficient way to implement the Repository Design Pattern in Laravel projects. With a custom Artisan command (make:repository), developers can automatically generate repository classes with pre-defined methods like index, store, u
README 文档
README
The Laravel Repository Maker package provides a simple and efficient way to implement the Repository Design Pattern in Laravel projects. With a custom Artisan command (make:repository), developers can automatically generate repository classes with pre-defined methods like index, store, update, and delete.
This tool is designed to enhance modularity, promote clean architecture, and save development time.
Installation
You can install the package via Composer.
- Run
composer requireto require the package:composer require shakib53626/laravel-repository-maker:dev-master
Usage
Once the package is installed, you can use the custom Artisan command to generate repository classes.
To generate a new repository, run:
php artisan make:repository TestRepository
This command will create a UserRepository class in the app/Repositories directory with default methods.
Generated Repository Structure
The generated repository class will include the following methods:
index(): Logic for listing resourcesstore(): Logic for storing a new resourceshow(): Logic for displaying a single resourceupdate(): Logic for updating a resourcedelete(): Logic for soft-deleting a resourcetrashList(): Logic for listing trashed resourcesrestore(): Logic for restoring a trashed resourcepermanentDelete(): Logic for permanently deleting a resource
Configuration
This package doesn't require any configuration out of the box. However, you can customize the generated repository methods according to your needs.
License
This package is licensed under the MIT License. See the LICENSE file for more information.
Contributing
If you'd like to contribute to the package, feel free to fork the repository and submit a pull request.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature/your-feature). - Create a new Pull Request.
Author
- Shakibul Islam
Email: diu.shakib@gmail.com
shakib53626/laravel-repository-maker 适用场景与选型建议
shakib53626/laravel-repository-maker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 shakib53626/laravel-repository-maker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shakib53626/laravel-repository-maker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-14