Skip to content

microdel/php-laravel-repositories

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Repositories

Implementation of Repository pattern for Laravel (on top of Eloquent)

Laravel 5.x

Install the saritasa/laravel-repositories package:

$ composer require saritasa/laravel-repositories

Available classes

IRepository

Interface, declaring common methods

Exceptions

Repository Exception

Should be thrown by class, implementing IRepository, if there is no more suitable exception defined.

Example:

function findWhere(array $fieldValues) {
    if (!count($fieldValues)) {
        new RepositoryException($this, "No search criteria provided");
    }
    // ...
}

Contributing

  1. Create fork
  2. Checkout fork
  3. Develop locally as usual. Code must follow PSR-1, PSR-2
  4. Run PHP_CodeSniffer to ensure, that code follows style guides
  5. Update README.md to describe new or changed functionality. Add changes description to CHANGES.md file.
  6. When ready, create pull request

Resources

About

Repository pattern implementation on top of Eloquent

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • PHP 99.6%
  • Makefile 0.4%