PHPackages                             abdelrahmanrafaat/repositories-maker - 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. abdelrahmanrafaat/repositories-maker

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

abdelrahmanrafaat/repositories-maker
====================================

creates repositories for Laravel models.

323242PHP

Since May 9Pushed 10y ago1 watchersCompare

[ Source](https://github.com/abdelrahmanrafaat/repositories-maker)[ Packagist](https://packagist.org/packages/abdelrahmanrafaat/repositories-maker)[ RSS](/packages/abdelrahmanrafaat-repositories-maker/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\##**Repositories Maker**\##

Repository pattern is an abstraction layer for your models.

Instead of writing tones of duplicated queries in your controllers.

You can make a repository that has a readable name and implements an interface(for changing the dependencies later) and bind the repository with it`s interface using the IOC container. Looks like lots of work to be done .....

**Repositories Maker** makes this process as easy as typing one artisan command.

1.Go to your laravel project root and type

`composer require abdelrahmanrafaat`/`repositories-maker:dev-master`

2.you need to register the package service provider .. Go to **config/app.php** and add this line to the end of the providers array. `Abdelrahmanrafaat\RepositoriesMaker\Provider\RepositoriesMakerServiceProvider::class`

3.This command should add a new command to your artisan list .. make:repositories

4.This Command Assumes that your models are at at **app** directory and extends **Model** class , but of course you can change this options as i will explain later.

`php artisan make:repositories`

This artisan command if you add **--help** to the end of it you will get the some options.

- \--**parent** : Specify the parent class of your models (Only the **class base name** not the full name space) or you can leave it **blank** if your models don`t extend a parent class or they extend different parent classes.
- \--**directory** : Directory that contains your models starting from the project root directory (this option can`t start with **/** Or \*\*\*\*).
- \--**nestedDirectories** : boolean option(**false** by default) indicates if your models are in nested directories.
- \--**except** : Comma seperated list of models that you don`t want to generate a repositories for.
- \--**only** : create repositories only for this Comma seperated list of models.

Note :

- except and only options don`t work togther you need to specifiy one of them.
- except and only model names are (**class base name** not the full name space)

5.If you run the command it will generate the repositories and interfaces in **app\\Repositories** and RepositoriesServiceProvider in the **app\\Provider** and the terminal will output the names of generated files.

6-you need to register the RepositoriesServiceProvider .. Go to **config/app.php** and add this line to the end of the providers array(make sure you change **App** if you have different namespace for your application).

`App\Providers\RepositoriesServiceProvider::class`

........

Now you are good to go , you can go to any class that has automatic resolution (controller , event , command ..) and type-hint the repository interface , and you will get a repository that has an instance of it`s model.

Happy coding ..

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1835b07a3966bc9a8802036e36d1731a65fa6296a1511fc026a536edaea823f0?d=identicon)[abdelrahmanrafaat](/maintainers/abdelrahmanrafaat)

---

Top Contributors

[![abdelrahmanrafaat](https://avatars.githubusercontent.com/u/17337459?v=4)](https://github.com/abdelrahmanrafaat "abdelrahmanrafaat (6 commits)")

### Embed Badge

![Health badge](/badges/abdelrahmanrafaat-repositories-maker/health.svg)

```
[![Health](https://phpackages.com/badges/abdelrahmanrafaat-repositories-maker/health.svg)](https://phpackages.com/packages/abdelrahmanrafaat-repositories-maker)
```

###  Alternatives

[wpmetabox/meta-box

The most powerful &amp; comprehensive plugin to create, manage, show and connect dynamic data with forms and custom fields effortlessly on WordPress.

1.2k20.5k3](/packages/wpmetabox-meta-box)

PHPackages © 2026

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