PHPackages                             ahmedmahmoud/repository-pattern - 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. [Framework](/categories/framework)
4. /
5. ahmedmahmoud/repository-pattern

ActiveLibrary[Framework](/categories/framework)

ahmedmahmoud/repository-pattern
===============================

A Laravel package to implement the Repository Pattern

5.0.0(11mo ago)010MITPHPPHP ^8.1

Since May 23Pushed 11mo agoCompare

[ Source](https://github.com/Ahmed1230000/repositories-pattern)[ Packagist](https://packagist.org/packages/ahmedmahmoud/repository-pattern)[ RSS](/packages/ahmedmahmoud-repository-pattern/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

Laravel Repository Pattern Generator
====================================

[](#laravel-repository-pattern-generator)

This 'Package' support only api A powerful package to automatically generate the complete repository pattern structure for your Laravel applications.

Features
--------

[](#features)

- 🚀 Auto-generates all repository pattern components with one command
- 📦 Includes: Model, Repository, Service, Controller, Form Requests, Migration
- 🔄 Supports both API
- ⚡ Easily extendable base classes
- 🔧 Customizable stubs

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

[](#installation)

1. Require the package via Composer:

```
composer require ahmedmahmoud/repository-pattern
```

2.(Optional) Publish stubs for customization:

```
php artisan vendor:publish --tag=repository-stubs --force
```

3. Run the setup command to install base files:

```
php artisan repository:setup
```

4. Generate complete structure for a new model:

```
php artisan make:repo {name : The name of the repository} --all (Includes: Model, Repository, Service, Controller, Form Requests, Migration}
```

🧩 Dependency Injection Binding
------------------------------

[](#-dependency-injection-binding)

The package automatically registers repository bindings in the service container:

```
$this->app->when(ProductService::class)
    ->needs(RepositoryInterface::class)
    ->give(ProductRepository::class);
```

if you not install api this return in your terminal
---------------------------------------------------

[](#if-you-not-install-api-this-return-in-your-terminal)

out when installed api then try this command again

```
php artisan make:repo student --all
Created migration file for students table.
Cannot write to C:\xampp_new\htdocs\first_package\routes/api.php. Please manually add the following to routes/api.php:
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\StudentController;

Route::resource('students', StudentController::class);
Repository pattern files for Student created successfully!
```

### How it works:

[](#how-it-works)

1. **when()**: Specifies the service class that needs dependency
2. **needs()**: Defines the interface/abstract type needed
3. **give()**: Provides the concrete implementation

You can find these bindings in: `app/Providers/RepositoriesServiceProvider.php`

And File `bootstrap/providers/RepositoriesServiceProvider.php`

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance50

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~0 days

Total

5

Last Release

351d ago

Major Versions

1.0.0 → 2.0.02025-05-23

2.0.0 → 3.0.02025-05-23

3.0.0 → 4.0.02025-05-23

4.0.0 → 5.0.02025-05-23

### Community

Maintainers

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

---

Top Contributors

[![Ahmed-web2133](https://avatars.githubusercontent.com/u/74884989?v=4)](https://github.com/Ahmed-web2133 "Ahmed-web2133 (16 commits)")[![Ahmed1230000](https://avatars.githubusercontent.com/u/75119743?v=4)](https://github.com/Ahmed1230000 "Ahmed1230000 (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ahmedmahmoud-repository-pattern/health.svg)

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

###  Alternatives

[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)[ecotone/laravel

Laravel integration for Ecotone

21307.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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