Created
February 8, 2014 08:51
-
-
Save coreymcmahon/8878763 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/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$repo = new Acme\Repositories\UserRepository; | |
// echo the name of the user with id 1 | |
echo $repo->find(1)->name; | |
// echo the number of users with username = johnsmith | |
echo count($repo->findByUsername('johnsmith')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment