PHPackages                             omatech/lars - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. omatech/lars

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

omatech/lars
============

v1.0.6(1y ago)05.4k11MITPHPPHP ^7.1|^7.2|^7.3|^7.4|^8.0

Since Jul 17Pushed 1y agoCompare

[ Source](https://github.com/omatech/lars)[ Packagist](https://packagist.org/packages/omatech/lars)[ Docs](https://github.com/omatech/lars)[ RSS](/packages/omatech-lars/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (9)Used By (1)

Laravel Repository System
=========================

[](#laravel-repository-system)

**LARS** abstract the data layer, making it easy to maintain.

[![Latest Version on Packagist](https://camo.githubusercontent.com/2e31eee3f132e4d68342f34d565e97613eceac751563546d58b9949da798496d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6d61746563682f6c6172732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/omatech/lars)[![Total Downloads](https://camo.githubusercontent.com/877c34386f34228d70523109135b80f2e7264d22b1d11b6a46dfab86e7ebf9de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6d61746563682f6c6172732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/omatech/lars)

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

[](#installation)

You can install the package via composer:

```
composer require omatech/lars
```

Usage
-----

[](#usage)

Create your own repository class extending BaseRepository class, use the model function to set the eloquent model for the repository.

```
class Repository extends BaseRepository
{
    public function model() : String
    {
        return Model::class;
    }
}
```

Now you can create your own function using query builder easily.

```
public function method()
{
    return $this->query()
                ->get();
}
```

### Criterias

[](#criterias)

Create a criteria implementing the interface CriteriaInterface. With the apply function you can filter by your own criteria.

```
public class Criteria implements CriteriaInterface
{
    public function apply(Builder $q) : Builder
    {
        return $q->where('role', 'admin');
    }
}
```

#### Use your criteria

[](#use-your-criteria)

```
public function method()
{
    return $this->pushCriteria(new FooCriteria)
                ->query()
                ->get();
}
```

#### List applied criterias

[](#list-applied-criterias)

```
public function method()
{
    return $this->getCriterias();
}
```

#### Remove an applied criteria

[](#remove-an-applied-criteria)

```
public function method()
{
    return $this->pushCriteria(new FooCriteria)
                ->popCriteria(new FooCriteria)
                ->query()
                ->get();
}
```

#### Remove all applied criterias

[](#remove-all-applied-criterias)

```
public function method()
{
    return $this->pushCriteria(new FooCriteria)
                ->pushCriteria(new BarCriteria)
                ->resetCriteria()
                ->query()
                ->get();
}
```

#### Global criterias for all methods in repository

[](#global-criterias-for-all-methods-in-repository)

It is possible to apply a criteria to all methods using the construct method of the repository.

```
public function __construct()
{
    $this->pushCriteria(new FooCriteria);
}
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Christian Bohollo](https://github.com/omatech)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance46

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~297 days

Recently: every ~368 days

Total

8

Last Release

412d ago

Major Versions

v0.0.1-alpha → v1.0.02019-07-18

PHP version history (3 changes)v0.0.1-alphaPHP ^7.1

v1.0.1PHP ^7.1|^7.2

v1.0.2PHP ^7.1|^7.2|^7.3|^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a6b2440a7864015d71501a9cd77d28bed549c283afdd8d1af95f54b650dc833?d=identicon)[aponscat](/maintainers/aponscat)

---

Top Contributors

[![hondilla](https://avatars.githubusercontent.com/u/7813599?v=4)](https://github.com/hondilla "hondilla (2 commits)")[![sarroyo-omatech](https://avatars.githubusercontent.com/u/66483009?v=4)](https://github.com/sarroyo-omatech "sarroyo-omatech (2 commits)")

---

Tags

omatechlars

### Embed Badge

![Health badge](/badges/omatech-lars/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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