PHPackages                             georgehanson/modelrepositorygenerator - 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. georgehanson/modelrepositorygenerator

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

georgehanson/modelrepositorygenerator
=====================================

A laravel package which generates a model, repository and contract

v0.1.0(9y ago)240PHP

Since Mar 8Pushed 8y agoCompare

[ Source](https://github.com/GeorgeHanson/Model-Repository-Generator)[ Packagist](https://packagist.org/packages/georgehanson/modelrepositorygenerator)[ RSS](/packages/georgehanson-modelrepositorygenerator/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

Model Repository Generator
==========================

[](#model-repository-generator)

***This package is archived***

This is a package for Laravel 5 which allows you to easily generate repositories, contracts and models. It brings two new automatic file creation commands (Repositories and Contracts), as well as enhancing the current model creation command.

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

[](#installation)

Once you have downloaded this package, you simply need to add the service provider to your `config/app.php` file. You should add the following service provider:

```
[
    ...
    GeorgeHanson\ModelRepositoryGenerator\ModelRepositoryGeneratorServiceProvider::class
    ...
]
```

Once you have added the package to your service provider, be sure to run `php artisan vendor:publish` to publish the config file. Once this is done you can use this config file to change where you would like your models, repositories and contracts to be stored. ***You do not need to include your main applications namespace.***

Generating Contracts
--------------------

[](#generating-contracts)

Generating contracts is simple and easy. Simply run the following command: `php artisan generate:contract ContractName`. Here you can set the contract name to whatever you would like.

Generating Repositories
-----------------------

[](#generating-repositories)

To generate a repository simply run the following command: `php artisan generate:repository Repository Model`. As you can see the first argument this command takes the name of the repository and the second is the name of the model this repository is for. This will also generate a contract for the repository and implement that contract on the newly created repository.

Enhanced Model Generation
-------------------------

[](#enhanced-model-generation)

This package enhances the default model creation command which comes by default with Laravel. To generate a model you can simply run the following command: `php artisan generate:model Model`, replacing "Model" with the name of your choice. Not only will this create a model, it will also create a contract for this model and make the model implement the newly created contract.

You can also automatically generate a repository by passing the `-R` flag. For example, `php artisan generate:model Model -R`. This will generate a model, a contract for that model, a repository for that model and a contract for the repository.

You can also pass through the default flags which come out of the box with laravel such as `-m` to create a migration or `-c`to create a controller.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

3401d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23167178?v=4)[George Hanson](/maintainers/GeorgeHanson)[@georgehanson](https://github.com/georgehanson)

---

Top Contributors

[![georgehanson](https://avatars.githubusercontent.com/u/23167178?v=4)](https://github.com/georgehanson "georgehanson (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/georgehanson-modelrepositorygenerator/health.svg)

```
[![Health](https://phpackages.com/badges/georgehanson-modelrepositorygenerator/health.svg)](https://phpackages.com/packages/georgehanson-modelrepositorygenerator)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M165](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20432.2M1.5k](/packages/illuminate-queue)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

201.4M2.2k](/packages/flarum-core)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4821.5k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

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