PHPackages                             wimski/laravel-model-repositories - 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. wimski/laravel-model-repositories

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

wimski/laravel-model-repositories
=================================

Laravel model repositories

v6.0.0(1y ago)335.2k↓26.1%MITPHPPHP ^8.3CI passing

Since Jan 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/wimski/laravel-model-repositories)[ Packagist](https://packagist.org/packages/wimski/laravel-model-repositories)[ Docs](https://github.com/wimski/laravel-model-repositories)[ RSS](/packages/wimski-laravel-model-repositories/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/c7cbe780254b83984d1be4850218100b4123a91798926d739f00c73ecf67387f/687474703a2f2f706f7365722e707567782e6f72672f77696d736b692f6c61726176656c2d6d6f64656c2d7265706f7369746f726965732f76)](https://packagist.org/packages/wimski/laravel-model-repositories)[![Coverage Status](https://camo.githubusercontent.com/115cc641b847ae7ca0917af5b7f9eb3db94682189021024b3f13410c4255d1d2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f77696d736b692f6c61726176656c2d6d6f64656c2d7265706f7369746f726965732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/wimski/laravel-model-repositories?branch=master)[![PHPUnit](https://github.com/wimski/laravel-model-repositories/actions/workflows/phpunit.yml/badge.svg)](https://github.com/wimski/laravel-model-repositories/actions/workflows/phpunit.yml)[![PHPStan](https://github.com/wimski/laravel-model-repositories/actions/workflows/phpstan.yml/badge.svg)](https://github.com/wimski/laravel-model-repositories/actions/workflows/phpstan.yml)

Laravel Model Repositories
==========================

[](#laravel-model-repositories)

Generic repository pattern for Laravel Eloquent models.

- [Changelog](#changelog)
- [Usage](#usage)
    - [Install package](#install-package)
    - [Setup service provider](#setup-service-provider)
    - [Generate a repository](#generate-a-repository)
    - [Add repository binding](#add-repository-binding)
- [Example usage](#example-usage)
- [Namespace configuration](#namespace-configuration)
    - [Assumptions](#assumptions)
    - [Default configuration](#default-configuration)
    - [Multiple configurations](#multiple-configurations)
    - [Specificity](#specificity)
- [Available methods](#available-methods)
- [Stub customization](#stub-customization)

Changelog
---------

[](#changelog)

[View the changelog.](./CHANGELOG.md)

Usage
-----

[](#usage)

### Install package

[](#install-package)

```
composer require wimski/laravel-model-repositories
```

### Setup service provider

[](#setup-service-provider)

This package is **NOT** loaded using [package discovery](https://laravel.com/docs/8.x/packages#package-discovery). You should create your own service provider that extends the one from this package and add it to your config manually.

`app/Providers/RepositoryServiceProvider.php`

```
