PHPackages                             smashed-egg/laravel-model-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. smashed-egg/laravel-model-repository

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

smashed-egg/laravel-model-repository
====================================

Add support for Model Repositories to Laravel

0.3.0(2y ago)08MITPHPPHP ^8.0.2

Since Jun 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/smashed-egg/laravel-model-repository)[ Packagist](https://packagist.org/packages/smashed-egg/laravel-model-repository)[ RSS](/packages/smashed-egg-laravel-model-repository/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (5)Versions (8)Used By (0)

 [![](https://raw.githubusercontent.com/smashed-egg/.github/05d922c99f1a3bddea88339064534566b941eca9/profile/main.jpg)](https://raw.githubusercontent.com/smashed-egg/.github/05d922c99f1a3bddea88339064534566b941eca9/profile/main.jpg)

Laravel Model Repository
========================

[](#laravel-model-repository)

[![Latest Stable Version](https://camo.githubusercontent.com/0900025684329692a94d81aed5489e0fda9fb17c9a0a59bacb37654a5c9e9cf9/68747470733a2f2f706f7365722e707567782e6f72672f736d61736865642d6567672f6c61726176656c2d6d6f64656c2d7265706f7369746f72792f762f737461626c65)](https://github.com/smashed-egg/laravel-model-repository/releases)[![Downloads this Month](https://camo.githubusercontent.com/54aa21daee39b728282e4d733e3110d2eaa3e33078d4fab0c2c8c679824e25b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f736d61736865642d6567672f6c61726176656c2d6d6f64656c2d7265706f7369746f72792e737667)](https://packagist.org/packages/smashed-egg/laravel-model-repository)

This package provides a Repository class for people who like SOLID principles (Separation of concerns and all that jazz) and want their repository logic in a different class.

Requirements
------------

[](#requirements)

- PHP 8.0.2+
- Laravel 9.0+

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

[](#installation)

To install this package please run:

```
composer require smashed-egg/laravel-model-repository

```

You can publish a configuration file that comes with the package:

```
php artisan vendor:publish --provider="SmashedEgg\LaravelModelRepository\ServiceProvider"

```

[Support Me](https://github.com/sponsors/tomgrohl)
--------------------------------------------------

[](#support-me)

Do you like this package? Does it improve you're development. Consider sponsoring to help with future development.

[Buy me a coffee!](https://github.com/sponsors/tomgrohl)

Thank you!

Usage
-----

[](#usage)

### Configuration (optional)

[](#configuration-optional)

If you have published the config file (located at config/smashed\_egg/model\_repository.php) you can override the base repository class used with the make command, as well as a model to repository mapping, which is useful when using the RepositoryManager class (more on that later).

```
