PHPackages                             edykim/laravel-container-helper - 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. edykim/laravel-container-helper

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

edykim/laravel-container-helper
===============================

A simple helper for Laravel service container

v0.0.2(2y ago)06MITPHPPHP &gt;=8.0.0

Since Jul 24Pushed 2y ago1 watchersCompare

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

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

Laravel Container Helper
========================

[](#laravel-container-helper)

[![Latest Stable Version](https://camo.githubusercontent.com/789dcb0e0064303108369e63ee7efb3c971b7011641c86de82253cea386bf50d/687474703a2f2f706f7365722e707567782e6f72672f6564796b696d2f6c61726176656c2d636f6e7461696e65722d68656c7065722f76)](https://packagist.org/packages/edykim/laravel-container-helper) [![License](https://camo.githubusercontent.com/72428dc0c07e23ee343b5358e136b72d82700b92370cdc818cee514aefcfb787/687474703a2f2f706f7365722e707567782e6f72672f6564796b696d2f6c61726176656c2d636f6e7461696e65722d68656c7065722f6c6963656e7365)](https://packagist.org/packages/edykim/laravel-container-helper) [![PHP Version Require](https://camo.githubusercontent.com/41819a85b4a086294e69eca811774e0c3f84c0b6afeae9718293df106589fb9d/687474703a2f2f706f7365722e707567782e6f72672f6564796b696d2f6c61726176656c2d636f6e7461696e65722d68656c7065722f726571756972652f706870)](https://packagist.org/packages/edykim/laravel-container-helper)

This package provides a simple helper for Laravel Container. It allows you to generate an inline utility class that implements a given interface, making your application's logic more configurable.

Getting Started
---------------

[](#getting-started)

### Installation

[](#installation)

```
$ composer require edykim/laravel-container-helper
```

### Lazy

[](#lazy)

This function offers a lazy-loaded proxy instance of a given concrete implementation for lazy instantiation.

```
use function Edykim\LaravelContainerHelper\Support\instance;

// ...
$app->bind(
  CalculatorInterface::class,
  instance(CalculatorInterface::class)
    ->lazy(HeavilyLoadedCalculator::class)
);
```

### Sequence

[](#sequence)

```
use function Edykim\LaravelContainerHelper\Support\instance;

// ...
$app->bind(
  CalculatorInterface::class,
  instance(CalculatorInterface::class)
    ->sequence(
      SimpleProductCalculator::class,
      DigitalProductCalculator::class,
      ShippingChargeCalculator::class,
    )
);
```

### Conditional

[](#conditional)

```
class HasDigitalProducts {
  public function check(Cart $cart): bool {
    // ...
  }
}
```

```
use function Edykim\LaravelContainerHelper\Support\instance;

// ...
$app->bind(
  CalculatorInterface::class,
  instance(CalculatorInterface::class)
    ->when(
      HasDigitalProduct::class,
      DigitalProductCalculator::class,
      SimpleProductCalculator::class,
    )
);
```

### Nested

[](#nested)

```
use function Edykim\LaravelContainerHelper\Support\instance;
use Edykim\LaravelContainerHelper\Support\Instance;

// ...
$app->bind(
  CalculatorInterface::class,
  instance(CalculatorInterface::class)
    ->with(fn (Instance $instance) =>
      $instance->sequence(
        $instance->lazy(
          $instance->when(
            HasCouponWithThirdPartyCompany::class,
            ThirdPartyCouponCalculator::class,
            NothingCalculator::class,
          ),
        ),
        SimpleProductCalculator::class,
        DigitalProductCalculator::class,
        $instance->when(
          [IsPlusLevelCustomer::class, 'validate'],
          PlusLevelCustomerDiscountCalculator::class,
          $instance->when(
            [IsMedicalProvider::class, 'validate'],
            MedicalProviderDiscountCalculator::class,
            NothingCalculator::class,
          ),
        ),
      ),
    );
);
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

2

Last Release

1024d ago

### Community

Maintainers

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

---

Top Contributors

[![edykim](https://avatars.githubusercontent.com/u/33057457?v=4)](https://github.com/edykim "edykim (3 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/edykim-laravel-container-helper/health.svg)

```
[![Health](https://phpackages.com/badges/edykim-laravel-container-helper/health.svg)](https://phpackages.com/packages/edykim-laravel-container-helper)
```

###  Alternatives

[alliedhealthmedia/icing

CakePHP Icing Plugin - Portable Package of Handy Utilities for CakePHP

218.0k](/packages/alliedhealthmedia-icing)

PHPackages © 2026

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