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

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

antarctica/laravel-base-repositories
====================================

A set of base repository interfaces and implementations for Laravel applications

v0.2.1(11y ago)03692MITPHPPHP &gt;=5.4.0

Since Dec 12Pushed 11y ago2 watchersCompare

[ Source](https://github.com/antarctica/laravel-base-repositories)[ Packagist](https://packagist.org/packages/antarctica/laravel-base-repositories)[ RSS](/packages/antarctica-laravel-base-repositories/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (2)

Laravel Base Repositories
=========================

[](#laravel-base-repositories)

A set of base [repository](http://msdn.microsoft.com/en-us/library/ff649690.aspx) interfaces and default implementations for Laravel applications.

Installing
----------

[](#installing)

Require this package in your `composer.json` file:

```
{
	"require-dev": {
		"antarctica/laravel-base-repositories": "~0.2"
	}
}
```

Run `composer update`.

Usage
-----

[](#usage)

### `BaseRepositoryInterface`

[](#baserepositoryinterface)

This package provides a very minimal interface of required methods for an abstract repository. That it is to say to aims to describe most of the basic/fundamental methods a typical repository/model would need.

For example: *find resource `x`* or *create a resource*.

Where a repository needs more specialised methods, to suit its particular needs, these can be added either directly to a repository class or to another interface that extends this one (if these extra methods are needed by other repositories).

Essentially this base interface is designed to provide the most common functionality that will almost certainly be needed.

See `BaseRepositoryInterface.php` for the specific methods this interface requires, each is documented inline using PHP DocBlocks.

##### Return types

[](#return-types)

In order to provide as neutral an interface as possible, data **MUST** be returned as **PHP standard arrays**.

This is to ensure implementations remain interoperable with each other by using a lowest common denominator approach.

This is specified within the implementation through type hinted DocBlock properties. However these rely on a either manual validation or features provided by your editor to be enforced.

#### Basic usage (Laravel)

[](#basic-usage-laravel)

```
