Download the PHP package um-flint/laravel-repository without Composer
On this page you can find all versions of the php package um-flint/laravel-repository. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download um-flint/laravel-repository
More information about um-flint/laravel-repository
Files in um-flint/laravel-repository
Download um-flint/laravel-repository
More information about um-flint/laravel-repository
Files in um-flint/laravel-repository
Vendor um-flint
Package laravel-repository
Short Description A repository pattern for Laravel.
License MIT
Package laravel-repository
Short Description A repository pattern for Laravel.
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-repository
Table of Contents
- Methods
- RepositoryInterface
- Traits
- SoftDeletes
- Hooks
- Validation
Methods
UMFlint\Repository\Contracts\RepositoryInterface
- lists($column, $key = null)
- pluck($column, $key = null)
- sync($id, $relation, $attributes, $detaching = true)
- syncWithoutDetaching($id, $relation, $attributes)
- all($columns = ['*'])
- paginate($limit = null, $columns = ['*'])
- simplePaginate($limit = null, $columns = ['*'])
- find($id, $columns = ['*'])
- findByField($field, $value, $columns = ['*'])
- findWhere(array $where, $columns = ['*'])
- findWhereIn($field, array $values, $columns = ['*'])
- findWhereNotIn($field, array $values, $columns = ['*'])
- create(array $attributes)
- update(array $attributes, $id)
- delete($id)
- orderBy($column, $direction = 'asc')
- has($relation)
- with($relations)
- whereHas($relation, $closure)
- withCount($relations)
- hidden(array $fields)
- visible(array $fields)
- scopeQuery(\Closure $scope)
- resetScope()
Traits
UMFlint\Traits\SoftDeletes
This trait allows for soft deletes:
- delete($id, $force = false)
In order to query for deleted entities:
- withTrashed()
To restore a soft deleted entity:
- restore($id)
Hooks
Boot
Anything that needs to happen when the repository class is created. Uses Laravels container for automatic injection.
- boot()
Create
- beforeCreate(&$attributes)
- afterCreate($model, &$attributes)
Update
- beforeUpdate($model, &$attributes)
- afterUpdate($model, &$attributes)
Delete
- beforeDelete($model)
- afterDelete($model, $deleted)
Restore
- beforeRestore($model)
- afterRestore($model)
Validation
Example rules:
To use it in a repository:
All versions of laravel-repository with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
illuminate/support Version ^8.0|^9.0
illuminate/validation Version ^8.0|^9.0
illuminate/database Version ^8.0|^9.0
illuminate/pagination Version ^8.0|^9.0
illuminate/support Version ^8.0|^9.0
illuminate/validation Version ^8.0|^9.0
illuminate/database Version ^8.0|^9.0
illuminate/pagination Version ^8.0|^9.0
The package um-flint/laravel-repository contains the following files
Loading the files please wait ....