Skip to content
Favre Anael edited this page May 16, 2016 · 1 revision

Implements a Repository pattern compatible with Eloquent.

Convention

Your eloquent scopes SHOULD be moved into your repositories.

Implementation (User example)

Add a protected property called $repository into your model (eg User.php) :

protected $repository = 'Path\To\UserRepository';

And create your UserRepository.php :

use WhiteFrame\Helloquent\Repository;

class UserRepository extends Repository
{
    protected $entity = 'Path\To\User';
}
Clone this wiki locally