PHPackages                             miladimos/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. miladimos/laravel-repository

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

miladimos/laravel-repository
============================

a powerful and simple to use package for repository pattern

0.8.8(3y ago)111812MITPHPPHP &gt;=7.4|^8.0

Since Sep 4Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/miladimos/laravel-repository)[ Packagist](https://packagist.org/packages/miladimos/laravel-repository)[ Docs](https://github.com/miladimos/laravel-repository)[ Fund](https://idpay.ir/laravelir)[ RSS](/packages/miladimos-laravel-repository/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (17)Used By (0)

- [![Starts](https://camo.githubusercontent.com/e32a8c5f121d1e84f2fefab6251aa746eb3d9958f628f297b059b25c94fd8942/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6d696c6164696d6f732f6c61726176656c2d7265706f7369746f72793f7374796c653d666c6174266c6f676f3d676974687562)](https://github.com/miladimos/laravel-repository/forks)
- [![Forks](https://camo.githubusercontent.com/b61058235f5b8af6e4bd0b9ae20dbe9718929e8b3b4dffc7dc364b6d27be98cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6d696c6164696d6f732f6c61726176656c2d7265706f7369746f72793f7374796c653d666c6174266c6f676f3d676974687562)](https://github.com/miladimos/laravel-repository/stargazers)

### in your project

[](#in-your-project)

`composer require miladimos/laravel-repository`

### for install package

[](#for-install-package)

`php artisan repository:install`

### for create new repository

[](#for-create-new-repository)

`php artisan make:repository {ModelName}`

### Example:

[](#example)

`php artisan make:repository Tag`

this create a TagRepository and TagEloquentRepositoryInterface

next you must add Repository to RepositoryServiceProvider in repositories property like:

```
protected $repositories = [
    [
        TagEloquentRepositoryInterface::class,
        TagRepository::class,
    ],
];
```

next in your controller add this:

```
private $tagRepo;
public function __construct(TagEloquentRepositoryInterface $tagRepo)
{
    $this->tagRepo = $tagRepo;
}
```

add custom methods in TagEloquentRepositoryInterface and implement them.

you must have a provider with below content and register it:

```
