PHPackages                             harshadeva/interface-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. harshadeva/interface-generator

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

harshadeva/interface-generator
==============================

Simplify Laravel development by generating repository and interface files with automatic service provider binding

v1.2.0(1y ago)115MITPHP

Since Dec 14Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (4)Used By (0)

**Interface Generator**
=======================

[](#interface-generator)

The `harshadeva/interface-generator` package simplifies the implementation of the Repository pattern in Laravel by automating the creation of interfaces, repositories, and service provider bindings. With a single Artisan command, you can generate custom repositories and interfaces, and ensure they are correctly bound in your application.

---

**Features**
------------

[](#features)

- **Automated Repository and Interface Creation**: Quickly generate repository and interface files using a simple Artisan command.
- **Dynamic Service Provider Binding**: Automatically binds repositories and interfaces to the `RepositoryServiceProvider`.
- **Smart Service Provider Management**: If the `RepositoryServiceProvider` does not exist, the package will create it and add it to the `config/app.php` providers array.

---

**Installation**
----------------

[](#installation)

Install the package via Composer:

```
composer require harshadeva/interface-generator
```

---

**Usage**
---------

[](#usage)

Generate a repository and interface using the Artisan command:

```
php artisan make:interface CustomName
```

### What Happens:

[](#what-happens)

1. The command generates:

    - `CustomNameRepositoryInterface`
    - `CustomNameRepository`
2. Binds the interface to its corresponding repository in the `RepositoryServiceProvider`.
3. If the `RepositoryServiceProvider` does not exist:

    - It will automatically create it.
    - Adds the `RepositoryServiceProvider` to the `config/app.php` providers array.

---

**Example**
-----------

[](#example)

Run the following command:

```
php artisan make:interface User
```

This will create:

- `App\Repositories\UserRepositoryInterface`
- `App\Repositories\UserRepository`

Additionally, the package will ensure the following binding is added to your `RepositoryServiceProvider`:

```
$this->app->bind(UserRepositoryInterface::class, UserRepository::class);
```

---

**New Feature: Publish Stubs**
------------------------------

[](#new-feature-publish-stubs)

The `interface-generator` package now supports publishing stub files for customizing the generated files. You can publish the stubs either using the custom Artisan command `interface-generator:stub-publish` or Laravel’s default `stub:publish` command.

### **What Happens When You Publish Stubs:**

[](#what-happens-when-you-publish-stubs)

- The stub files will be published to the `stubs/interface-generator` directory.
- These stubs serve as templates for generating repository interfaces and implementations, allowing you to customize the file structure, contents, or other aspects as needed.

### **How to Publish Stubs:**

[](#how-to-publish-stubs)

1. **Using the Custom Command:**

    ```
    php artisan interface-generator:stub-publish
    ```
2. **Using Laravel's Default Command:**If the package is already installed, you can publish the stubs via Laravel’s default `stub:publish` command:

    ```
    php artisan stub:publish
    ```

The published stubs will be located in the `stubs/interface-generator` directory, and you can modify them to suit your project’s needs. These stubs will be used as the base for creating files when running the `make:interface` command.

---

**Customizing the Output**
--------------------------

[](#customizing-the-output)

If you want to customize the directory structure or namespace, you can modify the generated files after they are created.

---

**Requirements**
----------------

[](#requirements)

- Laravel 8.x or higher
- PHP 7.4 or higher

---

**Contributing**
----------------

[](#contributing)

Contributions are welcome! Please feel free to submit a pull request or open an issue if you encounter any problems or have suggestions for new features.

---

**License**
-----------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance40

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

Total

3

Last Release

505d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

interfaceservice providerrepositorymakerbinder

### Embed Badge

![Health badge](/badges/harshadeva-interface-generator/health.svg)

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

###  Alternatives

[nette/robot-loader

🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.

89152.7M321](/packages/nette-robot-loader)[composer/satis

Simple Repository Generator

3.3k1.4M17](/packages/composer-satis)[samrap/acf-fluent

A fluent interface for the Advanced Custom Fields WordPress plugin

28656.0k4](/packages/samrap-acf-fluent)[lara-zeus/bolt

Zeus Bolt is form builder for your users, with so many use cases

23640.2k2](/packages/lara-zeus-bolt)

PHPackages © 2026

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