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.1(4w ago)6197MITPHPPHP &gt;=8.0

Since May 26Pushed 4w 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 today

READMEChangelogDependencies (2)Versions (4)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

41

—

FairBetter than 87% of packages

Maintenance86

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

Total

3

Last Release

29d ago

Major Versions

v1.0.0 → 2.0.02026-02-15

### Community

Maintainers

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

---

Top Contributors

[![rohitshakyaa](https://avatars.githubusercontent.com/u/92146757?v=4)](https://github.com/rohitshakyaa "rohitshakyaa (1 commits)")

### 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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M375](/packages/illuminate-redis)[spatie/laravel-export

Create a static site bundle from a Laravel app

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

PHPackages © 2026

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