PHPackages                             madewithlove/service-providers - 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. madewithlove/service-providers

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

madewithlove/service-providers
==============================

A repository of universal service providers for service-providers compliant containers

0.3.2(9y ago)249MITPHPPHP &gt;=5.6.0

Since Dec 9Pushed 9y agoCompare

[ Source](https://github.com/madewithlove/service-providers)[ Packagist](https://packagist.org/packages/madewithlove/service-providers)[ RSS](/packages/madewithlove-service-providers/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (18)Versions (8)Used By (0)

Madewithlove Service Providers
==============================

[](#madewithlove-service-providers)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ec2e72b5428368c8f86c3893b82505b84694810f66d27113bc6d48d982066a0d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d616465776974686c6f76652f736572766963652d70726f7669646572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/madewithlove/service-providers)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/91eb68f7fad71d065cddf555c9763686e55826d988050b6edfc9520e3a18aea6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d616465776974686c6f76652f736572766963652d70726f7669646572732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/madewithlove/service-providers)[![Coverage Status](https://camo.githubusercontent.com/8cb1f21d801b1f36c1b924d364ab11a97e3b4f2cb6e68eed2dc79e045a347c8a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6d616465776974686c6f76652f736572766963652d70726f7669646572732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/madewithlove/service-providers/code-structure)[![Quality Score](https://camo.githubusercontent.com/148a294dd1634b9323e526614ba1084124c7c01c35fef7ae1776551b94e42950/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d616465776974686c6f76652f736572766963652d70726f7669646572732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/madewithlove/service-providers)[![Total Downloads](https://camo.githubusercontent.com/2f09d9da6d12db9dd7cd63c8feee179ba50dd5da2882c8b0edc4570e87c7423a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d616465776974686c6f76652f736572766963652d70726f7669646572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/madewithlove/service-providers)

A repository of universal service providers for \[service-providers\] compliant containers

Install
-------

[](#install)

Via Composer

```
$ composer require madewithlove/service-providers
```

This repository **does not** ship with any third party package, you will need to install them yourself. If per example you need the `FlysystemServiceProvider` you would install Flysystem alongside this package.

Usage
-----

[](#usage)

### Service providers

[](#service-providers)

If the container you're using is already compatible with [service-provider](https://github.com/container-interop/service-provider) then register it like you simply would normally.

Otherwise you can use a decorator or bridge, you can find some on Packagist, and this package ships with some as well, per example for [league/container](http://container.thephpleague.com/):

```
use League\Flysystem\FilesystemInterface;
use League\League\Container;
use Madewithlove\ServiceProviders\Bridges\LeagueContainerDecorator;
use Madewithlove\ServiceProviders\Filesystem\FlysystemServiceProvider;

$container = new LeagueContainerDecorator(new Container());
$container->addServiceProvider(new FlysystemServiceProvider(...)));

$filesystem = $container->get(FilesystemInterface::class);
```

For providers with configuration, you can pass it as constructor argument. See the provider's signature for what options they take:

```
$provider = new EloquentServiceProvider([
    'local' => [
        'driver' => 'sqlite',
        'etc' => 'etc,
    ],
    'production' => [
        'driver' => 'mysql',
        'etc' => 'etc,
    ],
]);
```

### Utilities

[](#utilities)

This package also ships with some utilities to write your own service providers:

**Alias**: An alias to an existing value in the container:

```
public function getServices()
{
    return ['my_alias' => new Alias('to_something_else')];
}
```

**Parameter**: A plain value to store in the container:

```
public function getServices()
{
    return ['views_path' => new Parameter(__DIR__.'/views)];
}
```

**ParametersServiceProvider**: A blank service provider to quickly set multiple values in the container:

```
new ParametersServiceProvider([
    'foo' => 'bar',
    'bar' => 'baz',
]);

$container->get('foo'); // (string) "bar"
```

**PrefixedProvider**: A decorator to prefix a provider's services with a given string:

```
new PrefixedProvider('config', new ParametersServiceProvider([
    'foo' => 'bar',
]));

$container->get('config.foo'); // (string) "bar"
```

Available service providers
---------------------------

[](#available-service-providers)

```
├── Bridges
│   └── LeagueContainerDecorator.php
├── CommandBus
│   └── TacticianServiceProvider.php
├── Console
│   └── SymfonyConsoleServiceProvider.php
├── Database
│   ├── EloquentServiceProvider.php
│   └── FactoryMuffinServiceProvider.php
├── Development
│   ├── DebugbarServiceProvider.php
│   └── MonologServiceProvider.php
├── Events
│   └── LeagueEventsServiceProvider.php
├── Filesystem
│   └── FlysystemServiceProvider.php
├── Http
│   ├── LeagueRouteServiceProvider.php
│   ├── RelayServiceProvider.php
│   └── ZendDiactorosServiceProvider.php
├── Templating
│   └── TwigServiceProvider.php
└── Utilities
    ├── Alias.php
    ├── Parameter.php
    ├── ParametersServiceProvider.php
    └── PrefixedProvider.php

```

See the constructor arguments of each for the options they take. Contributions welcome!

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Anahkiasen](https://github.com/Anahkiasen)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Recently: every ~115 days

Total

7

Last Release

3387d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/df052a58ecfa5a07fd2b4cb12bb128ab28ff4b8e82fb0831eab81623b898ddb4?d=identicon)[madewithlove-machine-user](/maintainers/madewithlove-machine-user)

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

---

Top Contributors

[![Anahkiasen](https://avatars.githubusercontent.com/u/1321596?v=4)](https://github.com/Anahkiasen "Anahkiasen (47 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/madewithlove-service-providers/health.svg)

```
[![Health](https://phpackages.com/badges/madewithlove-service-providers/health.svg)](https://phpackages.com/packages/madewithlove-service-providers)
```

PHPackages © 2026

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