2017 © Pedro Peláez
 

library repositories

Laravel repositories with base repositories for eloquent with a cache decorator

image

knash94/repositories

Laravel repositories with base repositories for eloquent with a cache decorator

  • Saturday, May 6, 2017
  • by knash94
  • Repository
  • 1 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

knash94-repositories

Repositories is a package for Laravel that makes it much easier to create repositories for Laravel, whether you want just a Eloquent repository or an eloquent repository with cache., (*1)

Installation

Run the following command from your terminal, (*2)

composer require knash94/repositories

Open app/config with your favorite text editor and add the following line under package service providers, (*3)

Knash94\Repositories\RepositoryServiceProvider::class,

Usage

To create a basic repository without cache, (*4)

php artisan make:repository exampleRepository

or with cache, (*5)

php artisan make:repository exampleRepository --with-cache

Afterwards, open the new generated file under app/repositories/exampleRepository.php and find, (*6)

protected $model;

and replace it with your models class, for example, (*7)

protected $model = User::class;

After that you're all ready to go!, (*8)

Repository methods

public function all();

public function count();

public function countWhere($column, $value);

public function findById($id);

public function updateById($id, array $attributes);

public function create(array $attributes);

public function get();

public function groupBy($columns);

public function limit($limit);

public function orderBy($column, $direction = 'asc');

public function select($columns = ['*']);

public function where($column, $operator = null, $value = null, $boolean = 'and');

public function createMultiple(array $data);

public function with($relations);

The Versions

06/05 2017

dev-master

9999999-dev

Laravel repositories with base repositories for eloquent with a cache decorator

  Sources   Download

06/05 2017

v0.1.3

0.1.3.0

Laravel repositories with base repositories for eloquent with a cache decorator

  Sources   Download

07/04 2017

v0.1.2

0.1.2.0

Laravel repositories with base repositories for eloquent with a cache decorator

  Sources   Download

16/01 2017

0.1.1

0.1.1.0

Laravel repositories with base repositories for eloquent with a cache decorator

  Sources   Download

16/01 2017

0.1

0.1.0.0

Laravel repositories with base repositories for eloquent with a cache decorator

  Sources   Download