PHPackages                             yearnwilling/repository-services - 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. yearnwilling/repository-services

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

yearnwilling/repository-services
================================

the Repository-Service for laravel 5.5+

v0.1.2(9y ago)218MITPHPPHP &gt;=5.6.0

Since Apr 17Pushed 9y ago1 watchersCompare

[ Source](https://github.com/yearnwilling/Repository-Services)[ Packagist](https://packagist.org/packages/yearnwilling/repository-services)[ RSS](/packages/yearnwilling-repository-services/feed)WikiDiscussions master Synced 2w ago

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

Repository-Services
===================

[](#repository-services)

这个packagist主要是为laravel服务的。 使用方法可以参照我自己写的开源demo

```
https://github.com/yearnwilling/community

```

\###使用方法：

\#####Repository

```

    //对应需要访问的model
    protected $modelName = 'App\\Models\\User';

    public function model()
    {
        return $this->modelName;
    }

```

\#####Service

```
     /**
      * @param $RepositoryName string Repository名称
      * @param $Repository class Repository类对象
      */
     public function getRepository($RepositoryName, $Repository) {
         $this->registerRepository($RepositoryName, $Repository);
         return $this->repositories[$RepositoryName];
     }

     /**
       * @param $RepositoryName string Repository名称
       * @param $Repository class Repository类对象
       */
      public function getService($serviceName, $service) {
         $this->registerService($serviceName, $service);
         return $this->services[$serviceName];
     }

```

\#####Controller.php

```
    use Repository_services\Rsc\Service\Service;

    ...

    protected $baseServices;

    protected $resourcesNames = array(
        'UserService' => 'App\Services\User\UserServices',
    );

    public function __construct(Service $baseServices)
    {
        $this->baseServices =  $baseServices;
    }

    public function getService($serviceName) {
        $this->bootService($serviceName);
        return $this->baseServices->services[$serviceName];
    }

    protected function bootService($serviceName) {
        if (empty($this->resourcesNames[$serviceName])) {
            throw new \Exception("the $serviceName is not register in resourcesNames");
        }
        $this->baseServices->registerService($serviceName, $this->resourcesNames[$serviceName]);
    }

```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Every ~0 days

Total

3

Last Release

3361d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13409791?v=4)[willingwei](/maintainers/yearnwilling)[@yearnwilling](https://github.com/yearnwilling)

---

Top Contributors

[![yearnwilling](https://avatars.githubusercontent.com/u/13409791?v=4)](https://github.com/yearnwilling "yearnwilling (36 commits)")

---

Tags

laravelrepositoryservices

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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