定制 prjkt/repofuck 二次开发

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

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

prjkt/repofuck

Composer 安装命令:

composer require prjkt/repofuck

包简介

Fucking with the repository design pattern

README 文档

README

CircleCI

Fucking with the repository design pattern

Why?

Repofuck is dynamically persistent repository provider that also acts as a factory in runtime. Business logic can be written in the usual way or in closures if additional operations are needed before the data is given out. This eliminates the backdrop of needing predefined repository functions and replacing it by the entities themselves. Repofuck also features a dynamic mass assignment workflow where we can leverage predefined keys from Eloquent's getFillable or assign our own keys to be persisted in the repository. This way, when we're about to save the entity. The data itself is already persisted and can be manipulated on the fly for additional operations.

Sample Usage

$where = [
	['foo', 'LIKE', '%BAR%']
];

$data = $repo->prepare(function ($r) use ($where)
{
	//.. operations here
	$r->entity
		->with('relationship')
		->where($where);
	
})->get();

As you can see above. We are fetching data with the parameters with a relationship. The repository will be persisting the return of the callback and we can perform another operation. In which case we are performing a get.

Installing

composer require prjkt/repofuck

Prerequisites

  • PHP v7
  • Illuminate v5.1 or v5.2 or v5.3
    • Support
    • Database
    • Container
    • Contracts

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固