Skip to content

Instantly share code, notes, and snippets.

@coreymcmahon
Created February 8, 2014 08:48
Show Gist options
  • Save coreymcmahon/8878735 to your computer and use it in GitHub Desktop.
Save coreymcmahon/8878735 to your computer and use it in GitHub Desktop.
A Pattern for Reusable Repository Design in Laravel - http://www.slashnode.com/reusable-repository-design-in-laravel/
<?php namespace Acme\Repositories;
/**
* The UserRepositoryInterface contains ONLY method signatures for methods
* related to the User object.
*
* Note that we extend from RepositoryInterface, so any class that implements
* this interface must also provide all the standard eloquent methods (find, all, etc.)
*/
interface UserRepositoryInterface extends RepositoryInterface {
public function findUserByUsername($username);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment