PHPackages                             ipunkt/laravel-repositories - 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. ipunkt/laravel-repositories

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

ipunkt/laravel-repositories
===========================

Base repository implementation for laravel

2.0.0(9y ago)72.3kMITPHPPHP &gt;=5.3.0

Since Mar 20Pushed 9y ago2 watchersCompare

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

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

Generic repository implementation for Laravel
=============================================

[](#generic-repository-implementation-for-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/0fe7158b01350ff59e5fd87c61861c429b7bbb63bc24db53a4aa6a5cc62ff485/68747470733a2f2f706f7365722e707567782e6f72672f6970756e6b742f6c61726176656c2d7265706f7369746f726965732f762f737461626c652e737667)](https://packagist.org/packages/ipunkt/laravel-repositories) [![Latest Unstable Version](https://camo.githubusercontent.com/47e629d9e86ac58b49030c699eb48cdcb83662f4862d92f8119edead0a9a5e50/68747470733a2f2f706f7365722e707567782e6f72672f6970756e6b742f6c61726176656c2d7265706f7369746f726965732f762f756e737461626c652e737667)](https://packagist.org/packages/ipunkt/laravel-repositories) [![License](https://camo.githubusercontent.com/229cb63453edb629b8550f77165e2413667f731752d401223f3f1945b3df95c9/68747470733a2f2f706f7365722e707567782e6f72672f6970756e6b742f6c61726176656c2d7265706f7369746f726965732f6c6963656e73652e737667)](https://packagist.org/packages/ipunkt/laravel-repositories) [![Total Downloads](https://camo.githubusercontent.com/363f02d07339f6159d52edb5cbd124d73a90bc5b1ff0f37074c7ca8e57bd7089/68747470733a2f2f706f7365722e707567782e6f72672f6970756e6b742f6c61726176656c2d7265706f7369746f726965732f646f776e6c6f6164732e737667)](https://packagist.org/packages/ipunkt/laravel-repositories)

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

[](#installation)

Add to your composer.json following lines

```
"require": {
	"ipunkt/laravel-repositories": "~2.0"
}

```

Usage
-----

[](#usage)

### Repository Interfaces

[](#repository-interfaces)

Simply extend your interfaces by the provided interface `Ipunkt\LaravelRepositories\Contracts\RepositoryInterface`.

#### Example

[](#example)

```
use Ipunkt\LaravelRepositories\Contracts\RepositoryInterface;

interface HolidayRepository extends RepositoryInterface
{
	public function allByUser(User $user);
}

```

### Repository Classes

[](#repository-classes)

Simply extend your repository class by the provided `Ipunkt\LaravelRepositories\EloquentRepository`. It is an abstract class.

You need to have your own constructor which sets the internal property `model` to the appropriate model this repository will work on.

#### Example

[](#example-1)

```
use Ipunkt\LaravelRepositories\EloquentRepository;

class EloquentHolidayRepository extends EloquentRepository implements HolidayRepository
{
	/**
	 * @param Holiday $holiday eloquent model
	 */
	public function __construct(Holiday $holiday)
	{
		$this->model = $holiday;
	}

	/** implementing all methods in HolidayRepository */
}

```

### Registering with an Service Provider

[](#registering-with-an-service-provider)

You should register all repository stuff with a service provider to use it for example in a controller.

#### Example

[](#example-2)

```
class RepositoryServiceProvider extends ServiceProvider
{
	public function register()
	{
		//  binding interface HolidayRepository to the concrete implementation of EloquentHolidayRepository
		$this->app->bind(
			'HolidayRepository',
			function () {
				return new EloquentHolidayRepository(new Holiday());
			}
		);
	}
}

class HolidayController extends Controller
{
	private $repo;

	public function __construct(HolidayRepository $holidayRepository)
	{
		$this->repo = $holidayRepository;
	}
}

```

API Documentation
-----------------

[](#api-documentation)

Please look at the `Ipunkt\LaravelRepositories\Contracts\RepositoryInterface` for the current existing methods.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

3534d ago

Major Versions

1.0.1 → 2.0.02016-09-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4946056?v=4)[Robert Kummer](/maintainers/rokde)[@rokde](https://github.com/rokde)

---

Tags

phplaraveleloquentrepository patternrepository

### Embed Badge

![Health badge](/badges/ipunkt-laravel-repositories/health.svg)

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

###  Alternatives

[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[torann/laravel-repository

Base repository implementation for Laravel

88497.8k2](/packages/torann-laravel-repository)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5462.3k](/packages/io238-laravel-iso-countries)[sebastiaanluca/laravel-boolean-dates

Automatically convert Eloquent model boolean attributes to dates (and back).

40111.7k1](/packages/sebastiaanluca-laravel-boolean-dates)

PHPackages © 2026

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