PHPackages                             sinclairt/repository - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. sinclairt/repository

ActiveLibrary[Database &amp; ORM](/categories/database)

sinclairt/repository
====================

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

1.2.6(9y ago)04011MITPHP

Since Jan 12Pushed 9y agoCompare

[ Source](https://github.com/sinclairt/repository)[ Packagist](https://packagist.org/packages/sinclairt/repository)[ RSS](/packages/sinclairt-repository/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (19)Used By (1)

Repository
==========

[](#repository)

Common queries wrapped up into a class to be extended.

### Installation

[](#installation)

` composer require sinclairt/repository`

`composer install`

### Usage

[](#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!

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 54.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Recently: every ~42 days

Total

18

Last Release

3325d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16877448?v=4)[Tom Sinclair](/maintainers/sinclairt)[@sinclairt](https://github.com/sinclairt)

---

Top Contributors

[![tom-sinclair](https://avatars.githubusercontent.com/u/23167798?v=4)](https://github.com/tom-sinclair "tom-sinclair (6 commits)")[![sinclairt](https://avatars.githubusercontent.com/u/16877448?v=4)](https://github.com/sinclairt "sinclairt (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sinclairt-repository/health.svg)

```
[![Health](https://phpackages.com/badges/sinclairt-repository/health.svg)](https://phpackages.com/packages/sinclairt-repository)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
