Download the PHP package phucnguyenvn/laravel-eloquent-repository without Composer
On this page you can find all versions of the php package phucnguyenvn/laravel-eloquent-repository. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phucnguyenvn/laravel-eloquent-repository
More information about phucnguyenvn/laravel-eloquent-repository
Files in phucnguyenvn/laravel-eloquent-repository
Package laravel-eloquent-repository
Short Description Repository pattern for Eloquent ORM
License BSD-3-Clause
Informations about the package laravel-eloquent-repository
Eloquent Repository
Package to assist the implementation of the Repository Pattern using Eloquent ORM.
Installation
Installing via Composer
To configure the package options, declare the Service Provider in the config/app.php
file.
If you are using version 5.5 or higher of Laravel, the Service Provider is automatically recognized by Package Discover.
Usage
To get started you need to create your repository class and extend the EloquentRepository
available in the package. You also have to set the Model that will be used to perform the queries.
Example:
Now it is possible to perform queries in the same way as it is used in Eloquent.
To use the class, just inject them into the controllers.
The injection can also be done in the constructor to use the repository in all methods.
The Eloquent/QueryBuilder methods are encapsulated as protected and are available just into the repository class. Declare your own public data access methods within the repository to access them through the controller.
All versions of laravel-eloquent-repository with dependencies
illuminate/config Version ^5.1
illuminate/database Version ^5.1
illuminate/support Version ^5.1