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 3w ago

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

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

2063d ago

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

v1.1PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/58229155?v=4)[Michał Woliński](/maintainers/michalwolinski)[@michalwolinski](https://github.com/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

[laravel/octane

Supercharge your Laravel application's performance.

4.0k26.6M220](/packages/laravel-octane)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[laravel/nightwatch

The official Laravel Nightwatch package.

36210.1M35](/packages/laravel-nightwatch)[statamic/statamic

Statamic

829179.5k](/packages/statamic-statamic)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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