Implementation of Repository pattern for Laravel (on top of Eloquent)
Install the saritasa/laravel-repositories
package:
$ composer require saritasa/laravel-repositories
Interface, declaring common methods
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");
}
// ...
}
- Create fork
- Checkout fork
- Develop locally as usual. Code must follow PSR-1, PSR-2
- Run PHP_CodeSniffer to ensure, that code follows style guides
- Update README.md to describe new or changed functionality. Add changes description to CHANGES.md file.
- When ready, create pull request