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

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

ark4ne/laravel-repository
=========================

Laravel Repository

v0.1.0(4y ago)018MITPHPPHP ^7.4|^8.0

Since Apr 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Ark4ne/laravel-repository)[ Packagist](https://packagist.org/packages/ark4ne/laravel-repository)[ RSS](/packages/ark4ne-laravel-repository/feed)WikiDiscussions master Synced 3d ago

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

laravel-repository
==================

[](#laravel-repository)

Laravel Repository implementation

[![Build Status](https://camo.githubusercontent.com/f4d5dfee5c080ebf405d9c455bdbaf29ef2014e40a59f128f5b0872a421e6242/68747470733a2f2f7472617669732d63692e636f6d2f41726b346e652f6c61726176656c2d7265706f7369746f72792e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/Ark4ne/laravel-repository)[![Coverage Status](https://camo.githubusercontent.com/dff5ecdd1cf084ae3fad4e611e3788714de84c86155c3f0edfd700e0ee02f198/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f41726b346e652f6c61726176656c2d7265706f7369746f72792f62616467652e737667)](https://coveralls.io/github/Ark4ne/laravel-repository)

Usage
-----

[](#usage)

```
use Illuminate\Database\Eloquent\Model;

class Pet extends Model {
    // ...
}
```

```
use Ark4ne\Repositories\Contracts\RepositoryContract;

interface PetRepositoryContract extends RepositoryContract {
    //
}
```

```
use Ark4ne\Repositories\Eloquent\Repository;

class PetRepository extends Repository implements PetRepositoryContract {
    protected function getModel() : Pet {
        return new Pet;
    }
}
```

```
// RepositoryServiceProvider.php

public function register() {
    $this->app->bind(PetRepositoryContract::class, PetRepository::class);
}
```

```
// PetController.php

class PetController extends Controller {
    private $repository;

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

    public function store(PetStoreRequest $request) {
        $data = $request->validated();

        $pet = $this->repository->store($data);

        return new PetResource($pet);
    }
}
```

Methods
-------

[](#methods)

#### count

[](#count)

Count models matching $criteria.

```
count(array $criteria): int
```

#### all

[](#all)

Return all models matching $criteria.

```
all(): \Illuminate\Support\Collection
```

#### paginate

[](#paginate)

Return a paginate list of model matching $criteria.

```
paginate(array $criteria, int|null $per_page): \Illuminate\Contracts\Pagination\LengthAwarePaginator
```

#### find

[](#find)

Return a model by his id.

```
find(int|string $id): \Illuminate\Database\Eloquent\Model
```

#### findBy

[](#findby)

Return a model where $field match the given value.

```
findBy(string $field, mixed $value): \Illuminate\Database\Eloquent\Model
```

#### findByMany

[](#findbymany)

Return a model matching $criteria.

```
findByMany(array $criteria): \Illuminate\Database\Eloquent\Model
```

#### getWhere

[](#getwhere)

Return a collection of model where $field match the given value.

```
getWhere(string $field, mixed $value): \Illuminate\Support\Collection
```

#### getWhereMany

[](#getwheremany)

Return a collection of model matching $criteria.

```
getWhereMany(array $criteria): \Illuminate\Support\Collection
```

#### store

[](#store)

Create and return a new model.

```
store(array $data): \Illuminate\Database\Eloquent\Model
```

#### update

[](#update)

Update an existing model

```
update(int|string $id, array $data): \Illuminate\Database\Eloquent\Model
```

#### delete

[](#delete)

Delete an existing model

```
delete(int|string $id): bool
```

#### withCriteria

[](#withcriteria)

Add criteria

```
withCriteria(array $criteria): self
```

#### withRelationships

[](#withrelationships)

Add relationships that should be eager loaded.

```
withRelationships(array $relationships): self
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

3

Last Release

1803d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laraveldatabaseeloquentrepositoryrepositories

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[czim/laravel-repository

Repository for Laravel (inspired by and indebted to Bosnadev/Repositories)

54110.0k4](/packages/czim-laravel-repository)

PHPackages © 2026

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