2017 © Pedro Peláez
 

library repofuck

Fucking with the repository design pattern

image

prjkt/repofuck

Fucking with the repository design pattern

  • Tuesday, February 6, 2018
  • by rmrhz
  • Repository
  • 2 Watchers
  • 8 Stars
  • 3,143 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 14 Open issues
  • 28 Versions
  • 0 % Grown

The README.md

Repofuck

CircleCI, (*1)

Fucking with the repository design pattern, (*2)

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., (*3)

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., (*4)

Installing

composer require prjkt/repofuck, (*5)

Prerequisites

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

The Versions

06/02 2018

dev-master

9999999-dev

Fucking with the repository design pattern

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar rmrhz

01/04 2017

0.2.x-dev

0.2.9999999.9999999-dev

Fucking with the repository design pattern

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar rmrhz

08/03 2017

dev-stable

dev-stable

Fucking with the repository design pattern

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar rmrhz

08/03 2017