PHPackages                             bfg/repository - 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. [Database &amp; ORM](/categories/database)
4. /
5. bfg/repository

ActiveBfg-app[Database &amp; ORM](/categories/database)

bfg/repository
==============

Missing repositories for Eloquent models Laravel

v1.6.0(10mo ago)162.1k↑42.1%15MITPHPPHP &gt;=8.0.0

Since Jul 13Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/bfg-s/repository)[ Packagist](https://packagist.org/packages/bfg/repository)[ RSS](/packages/bfg-repository/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (15)Used By (5)

Extension repository
====================

[](#extension-repository)

Package To add the functionality of the repository pattern and its generator.

Install
-------

[](#install)

```
composer require bfg/repository
```

About
-----

[](#about)

The main feature of this package is the ability to remember the result of the executed function and return it when called again with the same parameters. How does this happen? When a repository property is called, it remembers the parameters and the result of the function. When the property is called again, it will return the result of the function that was remembered the first time it was called. For example, the repository has a `getUsers()` method that returns all users. The first time a method is called by a property, i.e. `$repository->getUsers`, it will execute the method and remember the result. When the property is called again, it will return the result of the method that was remembered the first time it was called.

Usage
-----

[](#usage)

### Make repository

[](#make-repository)

```
php artisan make:repository
```

```
Options:
      --methods[=METHODS]  Methods for repository (multiple values allowed)
  -m, --model[=MODEL]      Model of repository
  -f, --force              Create the class even if the repository already exists
```

### Next step

[](#next-step)

After generating the repository you will appear in the `app/Repositories` folder. And then you can add your methods to the created repository.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance54

Moderate activity, may be stable

Popularity32

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Recently: every ~215 days

Total

14

Last Release

318d ago

Major Versions

0.0.3 → 1.0.02022-02-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/59b2d162a30938ac2c3c56340ebea07a6778a3e1c86cb70b5bc28b69a1c3f04d?d=identicon)[bfg](/maintainers/bfg)

---

Top Contributors

[![Xsaven](https://avatars.githubusercontent.com/u/1726771?v=4)](https://github.com/Xsaven "Xsaven (50 commits)")

---

Tags

laravelextensionrepository

### Embed Badge

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

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

###  Alternatives

[illuminatech/config

Provides support for Laravel application runtime configuration managed in persistent storage

14921.0k1](/packages/illuminatech-config)[ozankurt/repoist

Laravel ^5.6 repository generator.

9244.1k](/packages/ozankurt-repoist)[dannyweeks/laravel-base-repository

An abstract repository class for your Eloquent repositories that requires minimal config to get started.

202.0k](/packages/dannyweeks-laravel-base-repository)

PHPackages © 2026

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