sinclairt/repository

Common queries wrapped up in a base repository class to be extended

1.2.6 2017-05-23 13:25 UTC

This package is not auto-updated.

Last update: 2024-12-22 03:39:39 UTC


README

Common queries wrapped up into a class to be extended.

Installation

composer require sinclairt/repository

composer install

Usage

All you need to do is create a repository that extends Sinclair\Repository\Repositories\Repository and implements the Sinclair\Repository\Contracts\Repository and off you go you have access to all the goodness of the repository!

This is a list of all the methods available to you

sort
getById
getAll
getAllPaginate
add
getByName
update
destroy
save
firstOrCreate
getArrayForSelect
getArrayForSelectWithTrashed
onlyFillable
getByIdWithTrashed
getAllWithTrashed
getAllPaginatedWithTrashed
restore
search
searchWithTrashed
filter
filterPaginated
setQuery
getQuery

F.Y.I All of the queries use Laravel's query builder methods, so be sure that your model class has access to these!