PHPackages                             shamaseen/laravel-repositories - 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. shamaseen/laravel-repositories

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

shamaseen/laravel-repositories
==============================

repository pattern files generator

3.0.3(8mo ago)611.1k↓46.2%3MITPHPPHP &gt;=8.2CI passing

Since Dec 6Pushed 8mo ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (59)Used By (0)

Laravel-Repositories
====================

[](#laravel-repositories)

[![Build Status](https://camo.githubusercontent.com/52bd94dbfcb16ea871ae67afa182c8ed7f5edda9bdced440f4082ca5a1401ccf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7368616d617365656e2f6c61726176656c2d7265706f7369746f726965732f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/mshamaseen/laravel-repositories/build-status/main) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/f7df9044203aa02c2cd0b8c89ba7d3208bcc843213c9e70b98f4f1941ccadbeb/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7368616d617365656e2f6c61726176656c2d7265706f7369746f726965732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/mshamaseen/laravel-repositories/?branch=main) [![Code Intelligence Status](https://camo.githubusercontent.com/6b72996b349b5a5212d64afacb69e364901e13e1d214a89aaab705eef567d748/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d7368616d617365656e2f6c61726176656c2d7265706f7369746f726965732f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d61696e)](https://scrutinizer-ci.com/code-intelligence)

A Laravel Repository generator with the best practice and tools already set and ready to be used.

What this package do?
---------------------

[](#what-this-package-do)

1. Commands to generate files, including repository files and others.
2. Enforcing single responsibility principle
3. Automatic CRUD out-of-the-box, whenever you generate a repository it will be CRUD-ready.
4. Automatic query searching - (when the frontend send search GET param)
5. Automatic query sorting - (when the frontend send order GET param)
6. Automatic query filtration

Introduction
------------

[](#introduction)

This package aim to provide auto file generation and base classes for the repository design pattern on Laravel.

Repository pattern forces you to have repository files in mediate between controllers and models, acting like a container where data access logic and business logic are stored.

### What is wrong with the MVC pattern?

[](#what-is-wrong-with-the-mvc-pattern)

MVC Violate the single responsibility principle in SOLID principles, where controller methods are responsible for the business logic and returning responses to the front-end users in the same time, making it impossible to re-use these methods or to independently testing the business logic in them.

### How repository design pattern works in this package?

[](#how-repository-design-pattern-works-in-this-package)

After a request is being sent to the Laravel application, it follows these steps:

1. The route catch the request and redirect it to its method in the controller
2. The controller then validate the request with the correct [request file](https://laravel.com/docs/validation#creating-form-requests).
3. If the validations passed, the controller then check the [policy](https://laravel.com/docs/authorization#creating-policies) authorization if available.
4. If it passed the controller then call the repository to retrieve the required data.
5. The repository implement the business logic and call the model to retrieve the required data from the database accordingly.
6. The repository process that data (if needed) and return the final result to the controller
7. The controller passes that data to the [resource file](https://laravel.com/docs/eloquent-resources) to format the data as needed.
8. The controller finally return the response back to the user.

[![repository_pattern.png](docs/images/repository_pattern.png)](docs/images/repository_pattern.png)

Quick Usage
-----------

[](#quick-usage)

Run:

```
php artisan generate:repository Test
```

This will generate the following files:

1. Test - (the Model file)
2. TestController
3. TestRepository
4. TestRequest
5. TestResource
6. TestPolicy
7. TestTest

Read the full document on [ReadTheDoc](https://laravel-repository-pattern.readthedocs.io/en/latest/index.html).

LICENSE
-------

[](#license)

MIT License

Versioning
----------

[](#versioning)

We follow [Semantic Versioning](https://semver.org/)

Roadmap
-------

[](#roadmap)

1. add the ability to disable caching from the config.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance61

Regular maintenance activity

Popularity32

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 83.9% 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 ~26 days

Recently: every ~57 days

Total

54

Last Release

243d ago

Major Versions

0.11.8 → 1.0.02022-02-14

1.1.7 → 2.0.02023-02-24

2.2.3 → 3.0.02025-01-30

2.x-dev → 3.0.12025-07-01

PHP version history (5 changes)0.1PHP &gt;=7.4

0.10.0PHP ^8.0

2.1.2PHP ^8.1

2.1.6PHP ^8

3.0.0PHP &gt;=8.2

### Community

Maintainers

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

---

Top Contributors

[![mshamaseen](https://avatars.githubusercontent.com/u/38951661?v=4)](https://github.com/mshamaseen "mshamaseen (125 commits)")[![angel-rec-ct](https://avatars.githubusercontent.com/u/103230482?v=4)](https://github.com/angel-rec-ct "angel-rec-ct (20 commits)")[![justice-bruce](https://avatars.githubusercontent.com/u/103230732?v=4)](https://github.com/justice-bruce "justice-bruce (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shamaseen-laravel-repositories/health.svg)

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

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4205.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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