PHPackages                             rohitshakyaa/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rohitshakyaa/repository-generator

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

rohitshakyaa/repository-generator
=================================

Laravel package to generate repositories with automatic interface and service provider binding.

2.0.0(2mo ago)6116MITPHPPHP &gt;=8.0

Since May 26Pushed 2mo agoCompare

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

READMEChangelogDependencies (1)Versions (3)Used By (0)

Laravel Repository Generator
============================

[](#laravel-repository-generator)

This Laravel package adds Artisan commands that:

- Creates a Repository class and its Interface
- Supports nested paths like `Config.RoleRepository`
- Automatically binds Interface to Implementation in `RepositoryServiceProvider`
- (Optional) Creates a Service class (with optional interface) and binds it in `ServiceServiceProvider`

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

[](#installation)

```
composer require rohitshakyaa/repository-generator
```

If Laravel doesn't auto-discover it, register manually in `config/app.php`:

```
'providers' => [
    RohitShakyaa\RepositoryGenerator\RepositoryGeneratorServiceProvider::class,
]
```

if Laravel &gt;= 11.\*, in `bootstrap/providers.php`

```
return [
    RohitShakyaa\RepositoryGenerator\RepositoryGeneratorServiceProvider::class,
]
```

Usage
-----

[](#usage)

```
php artisan make:repository UserRepository
php artisan make:repository Config.RoleRepository
```

By default this will generate:

```
app/Repositories/Config/RoleRepository.php
app/Repositories/Config/Interfaces/RoleRepositoryInterface.php

```

And it will auto-bind them in:

```
app/Providers/RepositoryServiceProvider.php

```

### Optional: also generate a Service

[](#optional-also-generate-a-service)

```
php artisan make:repository Config.RoleRepository --service
```

Generate a service + interface + binding:

```
php artisan make:repository Config.RoleRepository --service --service-interface
```

### make:service

[](#makeservice)

Create only a service class:

```
php artisan make:service Billing.InvoiceService
```

Create service + interface + auto-binding:

```
php artisan make:service Billing.InvoiceService --interface
```

And to remove repository

```
php artisan remove:repository UserRepository
php artisan remove:repository Config.RoleRepository
```

This will remove the files and the binding from `RepositoryServiceProvider`

### Publishing Stubs

[](#publishing-stubs)

To customize the stub files, publish them to your app:

```
php artisan vendor:publish --tag=repository-generator-stubs
```

### Publishing Config

[](#publishing-config)

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

#### Config options

[](#config-options)

You can change the base folders (relative to `app/`) and namespaces:

- `repositories.path` (default: `Repositories`)
- `services.path` (default: `Services`)

If you want the old v1.x behavior, set:

```
// config/repository-generator.php
'repositories' => [
    'path' => 'Http/Repositories',
],
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance83

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

Total

2

Last Release

85d ago

Major Versions

v1.0.0 → 2.0.02026-02-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/6977729bd5d96c8c94e678f1f27114d44c135a6b2995548998932205d0eb1bbb?d=identicon)[rohitshakyaa](/maintainers/rohitshakyaa)

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M686](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M861](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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