PHPackages                             theozebua/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. theozebua/laravel-repository

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

theozebua/laravel-repository
============================

Just a simple artisan command to create your repository pattern files.

v1.3.3(2y ago)5580[1 issues](https://github.com/theozebua/laravel-repository/issues)MITPHP

Since Jul 31Pushed 2y ago1 watchersCompare

[ Source](https://github.com/theozebua/laravel-repository)[ Packagist](https://packagist.org/packages/theozebua/laravel-repository)[ RSS](/packages/theozebua-laravel-repository/feed)WikiDiscussions 1.x Synced yesterday

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

Laravel Repository
==================

[](#laravel-repository)

Just a simple artisan command to generate your repository pattern files with ease.

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

[](#installation)

To install this package, you just install it with composer and you are ready to go.

```
composer require theozebua/laravel-repository --dev
```

Usage
-----

[](#usage)

To use this package, you just have to run:

```
php artisan repository:generate
```

And it will ask you some questions. See examples below.

### Generate A Repository Interface

[](#generate-a-repository-interface)

Run:

```
php artisan repository:generate
```

Then choose `Interface` either you type the the name or the index.

```
  What do you want to generate?
  Interface .............................................. 0
  Repository ............................................. 1
❯ Interface
```

Then type your interface name.

```
  What is the name of your interface? [RepositoryInterface]
❯ RepositoryInterface
```

That's it.

And the file will be placed in `app/Repositories/Interfaces/RepositoryInterface.php`.

> Note: This steps are for the first time you generate an interface when there are no interfaces created before. If you try to generate more interfaces afterwards, it will ask you additional questions. See example below.

### Generate A Repository Interface That Extends Another Interfaces

[](#generate-a-repository-interface-that-extends-another-interfaces)

Run:

```
php artisan repository:generate
```

Then choose `Interface` either you type the the name or the index.

```
  What do you want to generate?
  Interface .............................................. 0
  Repository ............................................. 1
❯ Interface
```

Then type your interface name.

```
  What is the name of your interface? [RepositoryInterface]
❯ RepositoryInterface
```

It will ask you if you want to extends another interfaces or not. If you choose `no`, the interface will be created without extending another interfaces. But for this example we choose `yes`.

```
  Do you want to extends another interfaces? (yes/no) [no]
❯ yes
```

And it will ask you to choose which interfaces do you want to extend.

Then choose interfaces that you want to extend, you can either type the interface name or the index. I will type the index because the interface name is too long to type.

```
  Please choose interface(s) that you want to extends separated by comma:
  App\Repositories\Interfaces\AnotherInterface ..................... 0
  App\Repositories\Interfaces\OtherInterface ....................... 1
❯ 0,1
```

And done.

### Generate A Repository Class

[](#generate-a-repository-class)

Run:

```
php artisan repository:generate
```

Then choose `Repository` either you type the the name or the index.

```
  What do you want to generate?
  Interface .............................................. 0
  Repository ............................................. 1
❯ Repository
```

Then type your repository name.

```
  What is the name of your repository? [Repository]
❯ Repository
```

That's it.

And the file will be placed in `app/Repositories/Implementations/Repository.php`.

> Note: Same as the interface generator, this steps are for the first time you generate a repository when there are no interfaces created before. If you try to generate more repositories afterwards, it will ask you additional questions. See example below.

### Generate A Repository Class That Implements Some Interfaces

[](#generate-a-repository-class-that-implements-some-interfaces)

Run:

```
php artisan repository:generate
```

Then choose `Repository` either you type the the name or the index.

```
  What do you want to generate?
  Interface .............................................. 0
  Repository ............................................. 1
❯ Repository
```

Then type your repository name.

```
  What is the name of your repository? [Repository]
❯ Repository
```

It will ask you if you want to implements some interfaces or not. If you choose `no`, the repository will be created without implementing any interfaces. But for this example we choose `yes`.

```
  Do you want to implements some interfaces? (yes/no) [no]
❯ yes
```

And it will ask you to choose which interfaces do you want to implement.

```
  Please choose interface(s) that you want to implements separated by comma:
  App\Repositories\Interfaces\AnotherInterface ..................... 0
  App\Repositories\Interfaces\OtherInterface ....................... 1
❯ 0,1
```

And done.

> Note: If your interface use php standard class or constant, make sure you add backslash `\` before it. E.g. `\PHP_EOL` or `\Iterator`, etc. Or you can use "use statement" on the top of the file. E.g. `use const PHP_EOL` or `use Iterator`, etc then you can use it without the backslash.

Configuration
-------------

[](#configuration)

Most of the time, you don't need to configure anything. But in case you want to configure the path, you can publish the configuration file with this simple command.

```
php artisan vendor:publish --tag=laravel-repository-config
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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 ~37 days

Recently: every ~4 days

Total

9

Last Release

771d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/87429668?v=4)[Theo Zebua](/maintainers/theozebua)[@theozebua](https://github.com/theozebua)

---

Top Contributors

[![theozebua](https://avatars.githubusercontent.com/u/87429668?v=4)](https://github.com/theozebua "theozebua (92 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/theozebua-laravel-repository/health.svg)

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

PHPackages © 2026

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