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

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

tbitencourt/laravel-repository-eloquent
=======================================

Easy MVC repository with Eloquent for Laravel 5 or later

1.2.1(6y ago)1841[1 issues](https://github.com/tbitencourt/laravel-repository-eloquent/issues)MITPHPPHP ~7.0.0||~7.1.0||~7.3.0||~7.4.0CI failing

Since Aug 18Pushed 6y agoCompare

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

READMEChangelog (3)Dependencies (1)Versions (6)Used By (0)

Laravel Repository Eloquent
===========================

[](#laravel-repository-eloquent)

[![Latest Stable Version](https://camo.githubusercontent.com/9d21e32ad30d811abd44a9e5a4b152756710812d89ca4cbac5941368a3427b96/68747470733a2f2f706f7365722e707567782e6f72672f74626974656e636f7572742f6c61726176656c2d7265706f7369746f72792d656c6f7175656e742f762f737461626c65)](https://packagist.org/packages/tbitencourt/laravel-repository-eloquent)[![Total Downloads](https://camo.githubusercontent.com/35e73c0499bbe3f9b08f8251dee988946382a235be8a5c47168308e48c13345a/68747470733a2f2f706f7365722e707567782e6f72672f74626974656e636f7572742f6c61726176656c2d7265706f7369746f72792d656c6f7175656e742f646f776e6c6f616473)](https://packagist.org/packages/tbitencourt/laravel-repository-eloquent)[![Build Status](https://camo.githubusercontent.com/3926dad8ae76189bd24203d77cf15270791bb7c1ba85eb54dc76e224c8a1b44d/68747470733a2f2f7472617669732d63692e6f72672f74626974656e636f7572742f6c61726176656c2d7265706f7369746f72792d656c6f7175656e742e706e67)](https://travis-ci.org/tbitencourt/laravel-repository-eloquent)[![License](https://camo.githubusercontent.com/29c8dfa0b2a5fd0404e196f275d19e0f72b937bf9f1756752d52a4f0673db4d2/68747470733a2f2f706f7365722e707567782e6f72672f74626974656e636f7572742f6c61726176656c2d7265706f7369746f72792d656c6f7175656e742f6c6963656e7365)](https://packagist.org/packages/tbitencourt/laravel-repository-eloquent)

Easy MVC repository with Eloquent for Laravel 5 or later, an useful tool to combine with Laravel Eloquent classes.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
    - [Laravel compatibility](#laravel-compatibility)
    - [Composer](#composer)
    - [Manually](#manually)
- [Config](#config)
- [Usage](#usage)
- [Changelog](#changelog)
- [License](#license)

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

[](#installation)

### Laravel compatibility

[](#laravel-compatibility)

Laravellaravel-repository-eloquent5.2.x-5.8.x (PHP 7 required)1.0.x (deprecated)5.2.x-6.0.x (PHP 7 required)1.1.x (deprecated)5.2.x-7.0.x (PHP 7 required)1.2.x### PHP 7 compatibility

[](#php-7-compatibility)

PHPlaravel-repository-eloquent7.0.x-7.3.x1.0.x7.0.x-7.4.x1.1.x7.0.x-7.4.x (Except 7.2.x)1.2.x### Composer

[](#composer)

Install the package via composer: `composer require tbitencourt/laravel-repository-eloquent`

### Manually

[](#manually)

Since Laravel 5.5, the service provider and facade will automatically get registered. For older versions of the framework, follow the steps below:

Register the service provider in `config/app.php`

```
        'providers' => [
		// [...]
                Tbitencourt\LaravelRepositoryEloquent\Providers\RepositoryEloquentServiceProvider::class,
        ],
```

Config
------

[](#config)

In order to edit the default configuration (where for e.g. you can find `supportedLocales`) for this package you may execute:

```
php artisan vendor:publish --provider="Tbitencourt\LaravelRepositoryEloquent\Providers\RepositoryEloquentServiceProvider"

```

After that, `config/repository.php` will be created. Inside this file you will find all the fields that can be edited in this package.

Usage
-----

[](#usage)

The first step is to store your repositories somewhere - anywhere. These will be simple declaration to start using it.

Here's an example of a repository.

```
use Tbitencourt\LaravelRepositoryEloquent\RepositoryEloquent;

class UserRepository extends RepositoryEloquent {

    /**
     * Specify \Illuminate\Database\Eloquent\Model class name
     * @return string
     */
    public function model()
    {
        return User::class;
    }
}
```

That's it! You're done. Now, within your controller and services, you can do:

```
    protected $repository;

    public __construct(UserRepository $repository)
    {
        $this->repository = $repository;
    }

    public index(Request $request)
    {
        $result = $this->repository->get();

        return view('myView');
    }
```

Notice how the call to the `repository` methods are equal to Eloquent so you doesn't need to learn new commands and proper use MVC repository.

Changelog
---------

[](#changelog)

View changelog here -&gt; [changelog](CHANGELOG.md)

License
-------

[](#license)

Laravel Localization is an open-sourced laravel package licensed under the MIT license

Have fun!

Thales

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~121 days

Total

3

Last Release

2216d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.0.0

1.2.1PHP ~7.0.0||~7.1.0||~7.3.0||~7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e002e3b94fbc35cf1192e52dc9e8bb92a4a4ebbfbbc47395abf34d0471746c5?d=identicon)[tbitencourt](/maintainers/tbitencourt)

---

Top Contributors

[![tbitencourt](https://avatars.githubusercontent.com/u/13469853?v=4)](https://github.com/tbitencourt "tbitencourt (34 commits)")

---

Tags

phplaraveleloquentrepository

### Embed Badge

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

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[langleyfoxall/xero-laravel

💸 Access the Xero accounting system using an Eloquent-like syntax

86235.1k](/packages/langleyfoxall-xero-laravel)[okaybueno/laravel-repositories

A package that provides a neat implementation to integrate the Repository pattern in Laravel with Eloquent.

1816.1k](/packages/okaybueno-laravel-repositories)[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3516.7k3](/packages/wayofdev-laravel-cycle-orm-adapter)[salehhashemi/laravel-repository

Implementing the repository pattern for Laravel projects.

2010.5k](/packages/salehhashemi-laravel-repository)[adobrovolsky97/laravel-repository-service-pattern

Laravel 5|6|7|8|9|10 - Repository - Service Pattern

275.4k](/packages/adobrovolsky97-laravel-repository-service-pattern)

PHPackages © 2026

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