PHPackages                             shamaseen/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. shamaseen/repository-generator

ActiveLibrary

shamaseen/repository-generator
==============================

repository pattern files generator

0.6.4(5y ago)4916.7k↓44.4%7MITPHP

Since Jan 14Pushed 4y ago5 watchersCompare

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

READMEChangelogDependencies (10)Versions (46)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a7f2c787c070c6d2a624a27a2e3038cdb7e8ad7363ed5c4d77d33e87b6ae9336/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7368616d617365656e2f6c61726176656c2d7265706f7369746f72792d7061747465726e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mshamaseen/laravel-repository-pattern/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/c4e2a490e1a2e9888a1760fce34d1b3b7369b5f035b17e4ff48cf642ea7decc7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7368616d617365656e2f6c61726176656c2d7265706f7369746f72792d7061747465726e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mshamaseen/laravel-repository-pattern/?branch=master)[![Build Status](https://camo.githubusercontent.com/5251167d6f571ed00ea88003dabfd1ddc71078047b8961aaf7f21defa449ccf7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7368616d617365656e2f6c61726176656c2d7265706f7369746f72792d7061747465726e2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mshamaseen/laravel-repository-pattern/build-status/master)[![Code Intelligence Status](https://camo.githubusercontent.com/ed0349bb9b09e12e805c7912e2e0bc05526ab033c10ca74b931cf4ce7d51386c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7368616d617365656e2f6c61726176656c2d7265706f7369746f72792d7061747465726e2f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![SymfonyInsight](https://camo.githubusercontent.com/93313783b215a6524d979f017faf2c4452356ab43b11c0a60c5e970b341e0710/68747470733a2f2f696e73696768742e73796d666f6e792e636f6d2f70726f6a656374732f66336564616237642d303062382d343633332d393664332d6138346533386237656265632f6d696e692e737667)](https://insight.symfony.com/projects/f3edab7d-00b8-4633-96d3-a84e38b7ebec)

**IMPORTANT:** We have created this repository to be a part of a specific workflow, it wasn't designed to be compatible with every project, but it became popular, so we decided to create a new better one with flexibility in mind, use [this package](https://github.com/mshamaseen/laravel-repositories) instead.

Repository Generator
====================

[](#repository-generator)

Autogeneration for repository pattern files, This package is aim to generate Contract (interface), Entity (model), Controller, Repository, Request validation and view files for specified module.

No Need to bind the interface to the repository, it will be auto-bind !

\*Note: if you are using laravel, you should've at least version **5.7**

Requirement
-----------

[](#requirement)

This package require the following dependencies: "illuminate/console": "^5.7", "illuminate/support": "^5.7"

Install
-------

[](#install)

1- Require this package with composer using the following command:

```
composer require shamaseen/repository-generator
```

2- publish the package config file by running:

```
php artisan vendor:publish
```

and select **repository-generator**.

3- To enable validation messages to be delivereid, You need to move `StartSession` and `ShareErrorsFromSession` from $middlewareGroups in http karnel to $middleware.

Publish stubs
-------------

[](#publish-stubs)

If you want to have a custom stubs rather than the default ones, you can change the path of the stubs folder in repository config, then run the following command:

```
php artisan vendor:publish
```

and select **repository-stub**, this will publish all the stub templates to the specified path on repository config. Feel free to edit stubs templates.

How to use
----------

[](#how-to-use)

To generate repository files run the following command:

```
php artisan make:repository {Folder/Classname (singular)}
```

where Folder is optional.

To generate views and languages files just add `--only-view` option in the command.

To remove a repository files that has been already created, you can use `Remover` like the following:

```
php artisan remove:repository {Folder/Classname (singular)}
```

Examples
--------

[](#examples)

To generate repository files for product, run the following:

```
php artisan make:repository Products/Product
```

Note: You can use Product instead of Products/Product, this will not make new folder with the class.

Then generate views and languages files:

```
php artisan make:repository Products/Product --only-view
```

License
-------

[](#license)

Repository-generator is a free software distributed under the terms of the MIT license.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~68 days

Total

45

Last Release

1965d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/94133296?v=4)[Hamza Shamaseen](/maintainers/shamaseen)[@shamaseen](https://github.com/shamaseen)

---

Top Contributors

[![HamzaAlayed](https://avatars.githubusercontent.com/u/7230722?v=4)](https://github.com/HamzaAlayed "HamzaAlayed (73 commits)")[![mshamaseen](https://avatars.githubusercontent.com/u/38951661?v=4)](https://github.com/mshamaseen "mshamaseen (72 commits)")[![elishaukpong](https://avatars.githubusercontent.com/u/31503827?v=4)](https://github.com/elishaukpong "elishaukpong (10 commits)")[![afolabiabass](https://avatars.githubusercontent.com/u/11009095?v=4)](https://github.com/afolabiabass "afolabiabass (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelrepositoryrepository-patternstubstubs

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[livewire/livewire

A front-end framework for Laravel.

23.5k75.5M1.8k](/packages/livewire-livewire)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

74310.9M66](/packages/laravel-mcp)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

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