dev-master
9999999-dev
MIT
The Requires
The Development Requires
v1.0.2
1.0.2.0
MIT
The Requires
The Development Requires
v1.0.1
1.0.1.0
MIT
The Requires
The Development Requires
Wallogit.com
2017 © Pedro Peláez
A base repository class for Eloquent with convenience methods that cover most queries. Useful to abstract away your persistence layer from your business code., (*2)
For Laravel 5.4 and above, (*3)
composer require bulwark/repoman ~1.0
The examples will use a hypothetical Eloquent model named User., (*4)
<?php
namespace App\Repositories;
use App\Models\User;
use Bulwark\Repoman\Repository;
class UserRepository extends Repository
{
protected function getModel()
{
return new User;
}
}
Repoman is already integrated with Bulwark\Dream.
See Dream documentation for more information.
The $options key given by all get-methods takes the following format:, (*5)
| Parameter | Value type | Description |
|---|---|---|
| includes | array | Array of relationships to eager load |
| sort | array | Array of sorting rules, e.g. [['key' => 'username', 'direction' => 'ASC']]
|
| filter_groups | array | See Dream documentation |
| limit | int | Rows per page |
| page | int | The page to start from (use with limit) |
Note: If you use the controller of Dream it will automatically parse the request's query string into the correct format., (*6)
The examples will use a hypothetical Eloquent model named User., (*7)
Get all User rows, (*8)
Get one User by primary key, (*9)
Get User rows ordered by created_at descending, (*10)
Get User rows where $column=$value, ordered by created_at descending, (*11)
Get User rows where $column=$value, (*12)
Get User rows by multiple where clauses ([$column1 => $value1, $column2 => $value2]), (*13)
Get User rows where $column can be any of the values given by $values, (*14)
Get the most recent User, (*15)
Get the most recent User where $column=$value, (*16)
Delete User rows by primary key, (*17)
Delete User rows where $column=$value, (*18)
This package is compliant with PSR-1, PSR-2 and PSR-4. If you notice compliance oversights, please send a patch via pull request., (*19)
bash
$ phpunit, (*20)
Please see CONTRIBUTING for details., (*21)
The MIT License (MIT). Please see License File for more information., (*22)
MIT
MIT
MIT