| Package Data | |
|---|---|
| Maintainer Username: | pieterdev |
| Maintainer Contact: | pietboth@gmail.com (Pieter Botha) |
| Package Create Date: | 2014-08-11 |
| Package Last Update: | 2014-08-28 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-01 15:00:58 |
| Package Statistics | |
|---|---|
| Total Downloads: | 23 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 1 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 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.
Simply:
protected static $filters= [...] array to your repository class denoting which properties on your model should be filterable.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;
}
}