PHPackages                             vtalbot/repository-generator - 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. [Framework](/categories/framework)
4. /
5. vtalbot/repository-generator

ActiveLibrary[Framework](/categories/framework)

vtalbot/repository-generator
============================

Repository Generator For Laravel 5

v1.1.3(10y ago)61.6k3MITPHPPHP &gt;=5.5.9

Since Sep 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/vtalbot/repository-generator)[ Packagist](https://packagist.org/packages/vtalbot/repository-generator)[ Docs](https://github.com/vtalbot/repository-generator)[ RSS](/packages/vtalbot-repository-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Repository Generator for Laravel 5.2
====================================

[](#repository-generator-for-laravel-52)

This package offer the possibility to generate repository based on the give model.

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

[](#installation)

Via Composer

```
$ composer require vtalbot/repository-generator --dev
```

Edit your `AppServiceProvider` to add the following to the `register` method:

```
    if ($this->app->environment() == 'local') {
        $this->app->register(\VTalbot\RepositoryGenerator\RepositoryGeneratorServiceProvider::class);
    }
```

Then execute the command:

```
$ php artisan vendor:publish  --provider="VTalbot\RepositoryGenerator\RepositoryGeneratorServiceProvider" --tag=config
```

Edit `config/repository.php` to your needs.

Usage (based on default config values)
--------------------------------------

[](#usage-based-on-default-config-values)

To create a simple repository:

```
$ php artisan make:repository User
Repository created:
> App\Repositories\UserRepository
```

To have a contract with the repository:

```
$ php artisan make:repository User --contract
Repository created:
> App\Repositories\DbUserRepository
> App\Repositories\Contracts\UserRepository
```

By default, the repository will have the methods: `all`, `find`, `create`, `update` and `delete`. You can Change the methods that will be added by using the options `--only=all,find` or `--except=all,find`. If you want a plain repository, use the option `--plain`.

A suffix is by default added to the repository, based on the config file. To change this value, you can provide the option `--suffix=Repo`. There is an option for the prefix when using the option `--contract`, by providing the option `--prefix=Ab`, which by default is `Db`.

If you want to change the name of the repository, you can use the option `--name=Users` to replace the model name and suffix.

```
$ php artisan make:repository User --name=Users --contract
Repository created:
> App\Repositories\DbUsers
> App\Repositories\Contracts\Users
```

If you want to automatically load the generated repositories, execute the following command:

```
$ php artisan make:repository:service
```

It accept a `name` argument to define the name you want and a `--namespace` option if your providers aren't inside the default `app/Providers`.

Changelog
---------

[](#changelog)

### v1.1.3

[](#v113)

- Fix newly created classes code style.

### v1.1.2

[](#v112)

- Add support for Laravel 5.2.

### v1.1.1

[](#v111)

- Fix class reflection test order.

### v1.1.0

[](#v110)

- Add repository service provider to load generated repositories with contract.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

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

Total

5

Last Release

3686d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd5ebc77c8a034abfc360655e03bc390ede754e1d9fddecffe3a17fb0f356d12?d=identicon)[vtalbot](/maintainers/vtalbot)

---

Top Contributors

[![vtalbot](https://avatars.githubusercontent.com/u/1474848?v=4)](https://github.com/vtalbot "vtalbot (11 commits)")

---

Tags

laravelgeneratorrepository

### Embed Badge

![Health badge](/badges/vtalbot-repository-generator/health.svg)

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

PHPackages © 2026

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