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: | 2024-11-21 03:00:44 |
Package Statistics | |
---|---|
Total Downloads: | 22 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
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;
}
}