PHPackages                             michalwolinski/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. [Framework](/categories/framework)
4. /
5. michalwolinski/repository

ActiveLibrary[Framework](/categories/framework)

michalwolinski/repository
=========================

Repository Pattern implementation for Laravel.

v1.1.1(5y ago)24MITPHPPHP ^7.4CI failing

Since Feb 4Pushed 5y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Repository
==========

[](#repository)

Repository Pattern implementation for Laravel. Criteria are based on Filter Design Pattern.

---

Installation by Composer
------------------------

[](#installation-by-composer)

1. Run ```
    composer require michalwolinski/repository
    ```

    in console to install this library.

---

Usage
-----

[](#usage)

I propose to use Dependency Injection to inject `Repository` interface.

Example implementation in service class:

```
use MichalWolinski\Repository\Criteria\OrderBy;
use MichalWolinski\Repository\Criteria\Status;
use MichalWolinski\Repository\Interfaces\Repository;
use App\User;

class Service {

    private Repository $repository;

    public function __construct(Repository $repository, User $user)
    {
        $this->repository = $repository->getInstance($user);
    }

    public function getAllUsers(): void
    {
        $allUsers = $this->repository->getAll();
    }

    public function getUserById(int $id): void
    {
        $user = $this->repository->get($id);
    }

    public function getUserByIds(array $ids): void
    {
        $users = $this->repository->getMany($ids);
    }

    public function getGmailUsers(): void
    {
        $users = $this->repository->getWhere('email', 'LIKE', '%@gmail.com');
    }

    public function getByCriteria(): void
    {
        $criteria = [
            new Status('Active'),
            new OrderBy('created_at')
        ];

        $users = $this->repository->getByCriteria($criteria);
    }

}
```

Authors
-------

[](#authors)

- **Michal Wolinski** - [Haxmedia](https://haxmedia.pl)

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Total

3

Last Release

2012d ago

PHP version history (2 changes)v1.0PHP ^7.4

v1.1PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravelrepository

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)

PHPackages © 2026

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