PHPackages                             rkooistra/super-eloquent-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. rkooistra/super-eloquent-repository

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

rkooistra/super-eloquent-repository
===================================

A concrete repository for Eloquent models to allow quick implementation of common functionalities, such as CRUD and search methods. Save yourself the boring stuff.

1.0.2-stable(6y ago)12.9k1MITPHPPHP &gt;=7.2CI failing

Since Dec 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/KakaCarrotCake/super-eloquent-repository)[ Packagist](https://packagist.org/packages/rkooistra/super-eloquent-repository)[ RSS](/packages/rkooistra-super-eloquent-repository/feed)WikiDiscussions dev Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (1)

Super Eloquent Repository
=========================

[](#super-eloquent-repository)

Introduction
------------

[](#introduction)

Welcome to the Super Eloquent Repository library package! This library has the simple use of eliminating having to write the same method over and over again for all your Repositories, allowing you to do the fun programming.

The package is basically a concrete superclass which you can extend all your default Eloquent repositories with. This superclass contains all basic functionalities which you would normally have to write again and again for normal CRUD methods.

How to install and use the package
----------------------------------

[](#how-to-install-and-use-the-package)

- Implement this package into your project by running `composer require rkooistra/super-eloquent-repository`.
- Create a class which extends the `RKooistra\SuperEloquentRepository\Abstracts\ConcreteResourceRepository` package.
- You must implement the `getModel()` stub per the inheritance rules; configure this to return the class of your respective model, ie: ```
    /** @return string  */
    protected function getModelClass(): string
    {
        return \App\Entities\User::class;
    }
    ```
- You should now be able to use all of the implemented methods!

Available methods (per 19-12-2019)
----------------------------------

[](#available-methods-per-19-12-2019)

```
public function getModel(): Builder;
public function setConnection($connection);
public function getAll(array $selectKeys = null, array $relations = null);
public function findByKey(
    string $key,
    string $value,
    array $selectKeys = null,
    array $relations = null
): Collection;
public function findByKeyWhereIn(
    string $key,
    array $array,
    array $selectKeys = null
): Collection;
public function findByKeyWhereNotIn(
    string $key,
    array $array,
    array $selectKeys = null
): Collection;
public function findOrFail(int $id, array $selectKeys = null): Model;
public function getAllResources (array $selectKeys = [], array $relations = []): Collection;
public function getAllResourcesWhereHas (string $whereHasRelation, $whereHasCallback, array $selectKeys = [], array $relations = []): Collection;
public function findByKeyWhereLike(string $key, string $value, array $selectKeys = null, array $relations = null): Collection;
public function updateResource(int $id, array $fields): int;
public function createResourceByArray(array $array): Model;
public function destroy(string $selectKey, array $ids): int;
public function destroyWhereNotIn(string $selectKey, array $ids): int;
public function firstOrCreate(array $insertables, string $identifierKey = 'id', array $selectKeys = [], array $relations = []): Model;
public function updateFirstOrCreate(array $insertables, string $identifierKey = 'id', array $selectKeys = [], array $relations = []): Model;
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~66 days

Total

3

Last Release

2205d ago

PHP version history (2 changes)1.0.0-stablePHP &gt;=7.3

1.0.1-stablePHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/5480a177ea25322f8f1614480df3fe58d0f6003e5c61dd55542fb63b26e35fe9?d=identicon)[keukenmagazijn](/maintainers/keukenmagazijn)

![](https://www.gravatar.com/avatar/ed60c20874c62ef2ee7ffe2361b26235145b5e2b77bed5cf8a60e54b8ce9f21d?d=identicon)[rkooistra](/maintainers/rkooistra)

---

Top Contributors

[![KakaCarrotCake](https://avatars.githubusercontent.com/u/93560378?v=4)](https://github.com/KakaCarrotCake "KakaCarrotCake (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rkooistra-super-eloquent-repository/health.svg)

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[abbasudo/laravel-purity

elegant way to add filter and sort in laravel

514330.5k1](/packages/abbasudo-laravel-purity)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)[stayallive/laravel-eloquent-observable

Register Eloquent model event listeners just-in-time directly from the model.

2928.9k7](/packages/stayallive-laravel-eloquent-observable)

PHPackages © 2026

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