PHPackages                             vydev/easy-repository - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. vydev/easy-repository

ActiveLibrary[Database &amp; ORM](/categories/database)

vydev/easy-repository
=====================

Laravel Repositories is a package for Laravel 5 or higher which is used to abstract the database layer. This makes applications much easier to maintain.

2.0.3(5y ago)3206MITPHPPHP ^7.1.3

Since Oct 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/svenit/laravel-repository)[ Packagist](https://packagist.org/packages/vydev/easy-repository)[ RSS](/packages/vydev-easy-repository/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (6)Used By (0)

Easy Repository
===============

[](#easy-repository)

[![Build Status](https://camo.githubusercontent.com/dd75c246e4a7850fc4840cd7f818bf7d6bd1879e041663d48fd2059e5828ba32/68747470733a2f2f7472617669732d63692e6f72672f4a756e696f72737a2f656173792d7265706f7369746f72792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Juniorsz/easy-repository)[![Maintainability](https://camo.githubusercontent.com/02fd49b424e265c9d30d610022269a33a3b1ae074cc22b1493b775ef3c8cbdec/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f36393030363138356536333832396236613330342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/Juniorsz/easy-repository/maintainability)

Laravel Repositories is a package for Laravel 5 which is used to abstract the database layer. This makes applications much easier to maintain.

Installation
------------

[](#installation)

Run the following command from you terminal:

```
$ composer require vydev/easy-repository
```

Usage
-----

[](#usage)

In `config/app.php`

Add `VyDev\Providers\RepositoryServiceProvider::class`

```
/*
* Package Service Providers...
*/

VyDev\Providers\RepositoryServiceProvider::class
```

Then run command

```
php artisan vendor:publish --provider "VyDev\Providers\RepositoryServiceProvider"
```

Edit `config/repositories.php` if you want to change Repository store path

**Run command to generate repository file**

Create a new repository

```
$ php artisan make:repository UserRepository
```

Then you can enter the name of Model to automatic generate or skip by enter @

If console throw error `Command "make:repository" is not defined."`

In : `app/Console/Kernel.php`

```
use VyDev\Commands\MakeCriteria;
use VyDev\Commands\MakeRepository;

protected $commands = [
    MakeCriteria::class,
    MakeRepository::class
];
```

Then run `php artisan optimize:clear`

```
