PHPackages                             detatech/repository-pattern - 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. detatech/repository-pattern

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

detatech/repository-pattern
===========================

Repository Pattern For Laravel &gt;= 5.1.\* | &gt;= 5.2.\* | &gt;= 5.3.\*

1.0.0(9y ago)032MITPHPPHP ~5.5|~5.6|~7.0

Since Aug 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/detatech/repository-pattern)[ Packagist](https://packagist.org/packages/detatech/repository-pattern)[ RSS](/packages/detatech-repository-pattern/feed)WikiDiscussions master Synced 2d ago

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

Repository Pattern For Laravel &gt;= 5.1.\* | &gt;= 5.2.\* | &gt;= 5.3.\*
-------------------------------------------------------------------------

[](#repository-pattern-for-laravel--51---52---53)

Create Repository Pattern Files with a single command.

### Usage

[](#usage)

- Require this package using composer

```
composer require detatech/repository-pattern:1.0.*

```

- Update the `$providers` array in `config/app.php`

```
$providers = [
    // ... other serivce providers

    DetaTech\RepositoryPattern\RepositoryPatternServiceProvider::class,
];

```

- Publish the default configuration (optional)

```
$ php artisan vendor:publish

```

---

You can now view the command `repository:create` has been listed in the artisan list. Checkout using

```
$ php artisan list

```

Once you create the file, you have to bind it to the IoC container of the application. For that, open `providers/AppServiceProvider` and inside the `register` method, paste the following code:

```
$repositoryFileNames = [
    // Whatever file name that you give while creating the file from
    // the terminal that same name should come here in single quotes(')
];

foreach ($repositoryFileNames as $key => $fileName) {
    // Notice the namespace..
    // Keep it default if you have not changed it,
    // Else, update the word _App_ with your application's namespace.

    $this->app->bind(
        "App\\Repositories\\Contracts\\{$fileName}Contract", "App\\Repositories\\Classes\\{$fileName}"
    );
}

```

Failing to do the above point will give Exception:

```
Target [/path/to/Contract/File] is not instantiable

```

Done.

### LICENSE

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3597d ago

Major Versions

0.1.1 → 1.0.02016-08-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21214329?v=4)[DetaTech Computers](/maintainers/detatech)[@detatech](https://github.com/detatech)

---

Top Contributors

[![MehulBawadia](https://avatars.githubusercontent.com/u/12674977?v=4)](https://github.com/MehulBawadia "MehulBawadia (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/detatech-repository-pattern/health.svg)

```
[![Health](https://phpackages.com/badges/detatech-repository-pattern/health.svg)](https://phpackages.com/packages/detatech-repository-pattern)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M184](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.5k](/packages/illuminate-queue)[illuminate/session

The Illuminate Session package.

9939.3M840](/packages/illuminate-session)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[moonshine/moonshine

Laravel administration panel

1.3k253.1k78](/packages/moonshine-moonshine)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
