Download the PHP package recca0120/repository without Composer
On this page you can find all versions of the php package recca0120/repository. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download recca0120/repository
More information about recca0120/repository
Files in recca0120/repository
Package repository
Short Description Repository for Laravel 5
License MIT
Informations about the package repository
Repository Design Pattern for Laravel
Install
To get the latest version of Laravel Exceptions, simply require the project using Composer:
Instead, you may of course manually update your require block and run composer update
if you so choose:
Methods
Recca0120\Repository\EloquentRepository
- find($id, $columns = ['*']);
- findMany($ids, $columns = ['*']);
- findOrFail($id, $columns = ['*']);
- findOrNew($id, $columns = ['*']);
- firstOrNew(array $attributes, array $values = []);
- firstOrCreate(array $attributes, array $values = []);
- updateOrCreate(array $attributes, array $values = []);
- firstOrFail($criteria = [], $columns = ['*']);
- create($attributes);
- forceCreate($attributes);
- update($id, $attributes);
- forceUpdate($id, $attributes);
- delete($id);
- forceDelete($id);
- newInstance($attributes = [], $exists = false);
- get($criteria = [], $columns = ['*']);
- chunk($criteria, $count, callable $callback);
- each($criteria, callable $callback, $count = 1000);
- first($criteria = [], $columns = ['*']);
- paginate($criteria = [], $perPage = null, $columns = ['*'], $pageName = 'page', $page = null);
- simplePaginate($criteria = [], $perPage = null, $columns = ['*'], $pageName = 'page', $page = null);
- count($criteria = [], $columns = '*');
- min($criteria, $column);
- max($criteria, $column);
- sum($criteria, $column);
- avg($criteria, $column);
- average($criteria, $column);
- matching($criteria);
- getQuery($criteria = []);
- getModel();
- newQuery();
Recca0120\Repository\Criteria
- static create()
- static expr($value)
- static raw($value)
- select($columns = ['*'])
- selectRaw($expression, array $bindings = [])
- selectSub($query, $as)
- addSelect($column)
- distinct()
- from($table)
- join($table, $first, $operator = null, $second = null, $type = 'inner', $where = false)
- joinWhere($table, $first, $operator, $second, $type = 'inner')
- leftJoin($table, $first, $operator = null, $second = null)
- leftJoinWhere($table, $first, $operator, $second)
- rightJoin($table, $first, $operator = null, $second = null)
- rightJoinWhere($table, $first, $operator, $second)
- crossJoin($table, $first = null, $operator = null, $second = null)
- mergeWheres($wheres, $bindings)
- tap($callback)
- where($column, $operator = null, $value = null, $boolean = 'and')
- orWhere($column, $operator = null, $value = null)
- whereColumn($first, $operator = null, $second = null, $boolean = 'and')
- orWhereColumn($first, $operator = null, $second = null)
- whereRaw($sql, $bindings = [], $boolean = 'and')
- orWhereRaw($sql, array $bindings = [])
- whereIn($column, $values, $boolean = 'and', $not = false)
- orWhereIn($column, $values)
- whereNotIn($column, $values, $boolean = 'and')
- orWhereNotIn($column, $values)
- whereNull($column, $boolean = 'and', $not = false)
- orWhereNull($column)
- whereNotNull($column, $boolean = 'and')
- whereBetween($column, array $values, $boolean = 'and', $not = false)
- orWhereBetween($column, array $values)
- whereNotBetween($column, array $values, $boolean = 'and')
- orWhereNotBetween($column, array $values)
- orWhereNotNull($column)
- whereDate($column, $operator, $value = null, $boolean = 'and')
- orWhereDate($column, $operator, $value)
- whereTime($column, $operator, $value, $boolean = 'and')
- orWhereTime($column, $operator, $value)
- whereDay($column, $operator, $value = null, $boolean = 'and')
- whereMonth($column, $operator, $value = null, $boolean = 'and')
- whereYear($column, $operator, $value = null, $boolean = 'and')
- whereNested(Closure $callback, $boolean = 'and')
- addNestedWhereQuery($query, $boolean = 'and')
- whereExists(Closure $callback, $boolean = 'and', $not = false)
- orWhereExists(Closure $callback, $not = false)
- whereNotExists(Closure $callback, $boolean = 'and')
- orWhereNotExists(Closure $callback)
- addWhereExistsQuery(Builder $query, $boolean = 'and', $not = false)
- dynamicWhere($method, $parameters)
- groupBy()
- having($column, $operator = null, $value = null, $boolean = 'and')
- orHaving($column, $operator = null, $value = null)
- havingRaw($sql, array $bindings = [], $boolean = 'and')
- orHavingRaw($sql, array $bindings = [])
- orderBy($column, $direction = 'asc')
- orderByDesc($column)
- latest($column = 'created_at')
- oldest($column = 'created_at')
- inRandomOrder($seed = '')
- orderByRaw($sql, $bindings = [])
- skip($value)
- offset($value)
- take($value)
- limit($value)
- forPage($page, $perPage = 15)
- forPageAfterId($perPage = 15, $lastId = 0, $column = 'id')
- union($query, $all = false)
- unionAll($query)
- lock($value = true)
- lockForUpdate()
- sharedLock()
- when($value, $callback, $default = null)
- unless($value, $callback, $default = null)
- whereKey($id)
- whereKeyNot($id)
- with($relations)
- without($relations)
- setQuery($query)
- setModel(Model $model)
- has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null)
- orHas($relation, $operator = '>=', $count = 1)
- doesntHave($relation, $boolean = 'and', Closure $callback = null)
- whereHas($relation, Closure $callback = null, $operator = '>=', $count = 1)
- orWhereHas($relation, Closure $callback = null, $operator = '>=', $count = 1)
- whereDoesntHave($relation, Closure $callback = null)
- withCount($relations)
- mergeConstraintsFrom(Builder $from)
- withTrashed()
- withoutTrashed()
- onlyTrashed()
Usage
Eloquent
Create a Model
Create your model normally, but it is important to define the attributes that can be filled from the input form data.
Create a Contract
Create a Repository
Bind
Controller
Methods
Find all results in Repository
Find all results in Repository with pagination
Count results in Repository
Create new entry in Repository
Update entry in Repository
Delete entry in Repository
New instance
Return Model With Conditions
Find result by id
Find by conditions
Using the Criteria
Criteria is support all of Eloquent functions
Single Criteria
Multiple Criteria
With
Join
Expression
Custom Criteria
ToDo
- Cache
All versions of repository with dependencies
illuminate/cache Version ^5.1|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/database Version ^5.1|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/events Version ^5.1|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/pagination Version ^5.1|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/support Version ^5.1|^6.0|^7.0|^8.0|^9.0|^10.0