PHPackages                             pieterdev/repoflow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. pieterdev/repoflow

ActiveLibrary[Database &amp; ORM](/categories/database)

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.

1.0.5(11y ago)123MITPHPPHP &gt;=5.4.0

Since Aug 11Pushed 11y ago1 watchersCompare

[ Source](https://github.com/pieterdev/repoflow)[ Packagist](https://packagist.org/packages/pieterdev/repoflow)[ RSS](/packages/pieterdev-repoflow/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

repoflow
========

[](#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.

Using it
--------

[](#using-it)

Simply:

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-&gt;whereName('Jack')-&gt;whereScore(3)-&gt;all();
5. The method `all()` invokes the query.

```
