承接 mtkh73/repo-handler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mtkh73/repo-handler

Composer 安装命令:

composer require mtkh73/repo-handler

包简介

optimize and make rewritable your project with the repository pattern

README 文档

README

Build Status Total Downloads Latest Stable Version License

About RepositoryPattern

The Repository Pattern is one of the most popular patterns to create an enterprise level application. It restricts us to work directly with the data in the application and creates new layers for database operations, business logic, and the application’s UI. using the Repository Pattern has many advantages:

  • Your business logic can be unit tested without data access logic;
  • The database access code can be reused;
  • Your database access code is centrally managed so easy to implement any database access policies, like caching;
  • It’s easy to implement domain logic;
  • Your domain entities or business entities are strongly typed with annotations; and more.

How to work with this package

php artisan make:repository ModelName

After installing this package, a command will be added on your artisan command with make:repository name. with this command you can create a repository class for your model classes.

After running this command if the model exists, a directory called Repository creates in your app directory.to use your repository class you can inject it in any controller that you want. after that you can easily use all of the features in your repository class.

etc

php artisan make:repository Models\User

In this example, you can see a method with setFilters name!

you can apply your any eloquent filters on your query.but where is these filters??

You can create your filters with this command:

php artisan make:filter With'

After creating the filter, the structure of this class like this :

The implementation of your filter must be in the handle method! the args variable includes the value that you set on the setFilters method!

Be careful after creating the filters, you have to set filters on the repository config file.

In the repositories directory, there are 4 things!

  • a BaseRepository class that is the parent of all repositories that you created in your project and includes and contains a number of functions that can be the same in your repository classes.
  • a BaseRepositoryInterface class
  • a RepositoryServiceProvider for binding your repository classes to the interface that previously made.
  • and finally, a directory with your model name that includes a repository class is created and a directory with contracts name.

Be careful If you want using your repository class with their contracts you have to bind them together on the RepositoryServiceProvider class!

License

The RepositoryPattern-handler is open-sourced software licensed under the MIT license.

mtkh73/repo-handler 适用场景与选型建议

mtkh73/repo-handler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 3, 最近一次更新时间为 2020 年 01 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「pattern」 「repository」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 mtkh73/repo-handler 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-25