PHPackages                             inquiloper/laravel-baserepository - 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. inquiloper/laravel-baserepository

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

inquiloper/laravel-baserepository
=================================

A base repository that wraps some of laravel eloquent's functionality so you can share it among your own repositories.

1.0.2(7y ago)096MITPHP

Since Jul 28Pushed 7y agoCompare

[ Source](https://github.com/inquiloper/laravel-baserepository)[ Packagist](https://packagist.org/packages/inquiloper/laravel-baserepository)[ RSS](/packages/inquiloper-laravel-baserepository/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (4)Used By (0)

### Laravel Base Repository

[](#laravel-base-repository)

#### Description

[](#description)

A wrapper around eloquent's main features so you can share them among your own repositories

#### Installation

[](#installation)

In order to install this package, all you have to do is execute the following line in your console `composer require inquiloper/laravel-baserepository`

Then in your repositories

```
    use Inquiloper\BaseRepository;
    use App\User;
    class UsersRepository extends from BaseRepository implements UsersRepositoryInterface {

        public function __construct(User $user){
            parent::__construct($user);
        }
    }
```

That's it, you're ready to rock now!

#### Documentation

[](#documentation)

Let's suppose you have this function in your controller where you type-hint your repo

`public function users(UsersRepositoryInterface $usersRepo){}`

Now, the methods you have available are:

###### Find all elements of the model

[](#find-all-elements-of-the-model)

` $usersRepo->findAll()`

###### Find one element by $field

[](#find-one-element-by-field)

`$usersRepo->findOneBy(Array $fields)`

###### Find All elements by $fields

[](#find-all-elements-by-fields)

`$usersRepo->findAllBy(Array $fields)`

###### Create and save to the DB

[](#create-and-save-to-the-db)

` $usersRepo->create(Array $data)`

###### Update with $data by $fields

[](#update-with-data-by-fields)

`$usersRepo->updateBy(Array $fields, Array $data)`public function with($relationships);

###### Update with $data by $fields

[](#update-with-data-by-fields-1)

`$usersRepo->updateBy(Array $fields, Array $data)`

###### Delete by $fields

[](#delete-by-fields)

`$usersRepo->deleteBy(Array $fields)`

###### Eager-load relationships

[](#eager-load-relationships)

`$usersRepo->with(['posts', 'comments'])->findOneBy(['id' => 1])`

###### Dynamic methods

[](#dynamic-methods)

You can call the findOneBy method with a dynamic name like so:

`$usersRepo->findOneByName('John Doe')`

This will translate to `select * from users where name = 'John Doe' limit 1 `

> The dynamic calling will automatically snake\_case anything after findOneBy , so Name converts to name, UserEmail to user\_email and so on. You can turn this off and the method will add the where clause with the literal name

`$usersRepo->findOneByWpEmail('email@example.com' , false)`

This will translate to `select * from users where WpEmail = 'email@example.com' limit 1`

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

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

Total

3

Last Release

2841d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b044e89c6fe911e53da0521d5030895600afe2cc539049a92bdb7e5c4859235?d=identicon)[inquiloper](/maintainers/inquiloper)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/inquiloper-laravel-baserepository/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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