PHPackages                             creode/laravel-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. creode/laravel-repository

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

creode/laravel-repository
=========================

Exposes a base repository class that allows interactions with custom models.

1.1.0(1y ago)02.6k[1 issues](https://github.com/creode-modules/laravel-repository/issues)8MITPHP

Since Dec 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/creode-modules/laravel-repository)[ Packagist](https://packagist.org/packages/creode/laravel-repository)[ RSS](/packages/creode-laravel-repository/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (8)

Laravel Repository
==================

[](#laravel-repository)

Exposes a base repository class that allows interactions with custom models.

Installation
------------

[](#installation)

```
composer require creode/laravel-repository
```

Usage
-----

[](#usage)

To use this package, you must extend the base repository abstract class and override the getModel() method to return the model class you wish to use.

```
use Creode\LaravelRepository\BaseRepository;

class MyRepository extends BaseRepository
{
    /**
     * Returns the model class to use for this repository.
     *
     * @return string
     */
    protected function getModel()
    {
        return MyModel::class;
    }
}
```

This repository can then be called in any other class.

The benefit of utilising this class in your code means that you can rebind your model class using a namespace config string in your application. By swapping any hardcoded references to model classes directly with the repository, you can still call standard model functions on it but it allows dynamic binding at runtime.

For more details about the repository pattern see this article on the benefits of it:

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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 ~62 days

Total

4

Last Release

695d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8133041?v=4)[Creode](/maintainers/creode)[@creode](https://github.com/creode)

---

Top Contributors

[![jaymeh](https://avatars.githubusercontent.com/u/18261676?v=4)](https://github.com/jaymeh "jaymeh (12 commits)")[![creode-dev](https://avatars.githubusercontent.com/u/19706903?v=4)](https://github.com/creode-dev "creode-dev (2 commits)")

### Embed Badge

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

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

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[staudenmeir/eloquent-json-relations

Laravel Eloquent relationships with JSON keys

1.1k5.8M24](/packages/staudenmeir-eloquent-json-relations)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)[gearbox-solutions/eloquent-filemaker

A package for getting FileMaker records as Eloquent models in Laravel

6454.8k2](/packages/gearbox-solutions-eloquent-filemaker)[cybercog/laravel-ownership

Laravel Ownership simplify management of Eloquent model's owner.

9126.6k3](/packages/cybercog-laravel-ownership)

PHPackages © 2026

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