2017 © Pedro Peláez
 

library repoflow

A simple trait to allow fluently querying repositories with an eloquent model. Gives back the flexibility of eloquent to some extent, while remaining explicit on which methods are supported by a repository.

image

pieterdev/repoflow

A simple trait to allow fluently querying repositories with an eloquent model. Gives back the flexibility of eloquent to some extent, while remaining explicit on which methods are supported by a repository.

  • Thursday, August 28, 2014
  • by pieterdev
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

repoflow

A simple trait to allow fluently querying repositories with an eloquent model. Gives back the flexibility of eloquent to some extent, while remaining explicit on which methods are supported by a repository., (*1)

Using it

Simply:, (*2)

  1. Add the Pieterdev\Repoflow\FluentRepositoryTrait to your repository class.
  2. Add a protected static $filters= [...] array to your repository class denoting which properties on your model should be filterable.
  3. Have the model your repository is using as a field called $model on your repository class, or have $model be a string containing the name of the eloquent model used by the repository.
  4. You can then do chain queries on your repository, for example `$repo->whereName('Jack')->whereScore(3)->all();
  5. The method all() invokes the query.
<?php

class SomeEloquentRepository implements ISomeRepository {

    use Pieterdev\Repoflow\FluentRepositoryTrait;

    protected static $filters = [
        'name',
        'score'
    ];

    protected $model;

    function __construct(User $userModel) 
    {
        $this->model = $userModel;
    }
}

The Versions

28/08 2014

dev-master

9999999-dev

A simple trait to allow fluently querying repositories with an eloquent model. Gives back the flexibility of eloquent to some extent, while remaining explicit on which methods are supported by a repository.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Pieter Botha

laravel repository api eloquent trait fluent seperation of concerns

12/08 2014

1.0.5

1.0.5.0

A simple trait to allow fluently querying repositories with an eloquent model. Gives back the flexibility of eloquent to some extent, while remaining explicit on which methods are supported by a repository.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Pieter Botha

laravel repository api eloquent trait fluent seperation of concerns

12/08 2014

1.0.4

1.0.4.0

A simple trait to allow fluently querying repositories with an eloquent model. Gives back the flexibility of eloquent to some extent, while remaining explicit on which methods are supported by a repository.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Pieter Botha

laravel repository api eloquent trait fluent seperation of concerns

12/08 2014

1.0.3

1.0.3.0

A simple trait to allow fluently querying repositories with an eloquent model. Gives back the flexibility of eloquent to some extent, while remaining explicit on which methods are supported by a repository.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Pieter Botha

laravel repository api eloquent trait fluent seperation of concerns

12/08 2014

1.0.2

1.0.2.0

A simple trait to allow fluently querying repositories with an eloquent model. Gives back the flexibility of eloquent to some extent, while remaining explicit on which methods are supported by a repository.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pieter Botha

laravel repository api eloquent trait fluent seperation of concerns

12/08 2014

1.0.1

1.0.1.0

A simple trait to allow fluently querying repositories with an eloquent model. Gives back the flexibility of eloquent to some extent, while remaining explicit on which methods are supported by a repository.

  Sources   Download

The Requires

 

The Development Requires

by Pieter Botha