PHPackages                             lachezargrigorov/laravel-closures-container - 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. lachezargrigorov/laravel-closures-container

ActiveLibrary

lachezargrigorov/laravel-closures-container
===========================================

Easy to use closures container for Laravel. First register the closure then use it anywhere.

v1.0.1(8y ago)09MITPHPPHP &gt;=5.5.9

Since Oct 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/lachezargrigorov/laravel-closures-container)[ Packagist](https://packagist.org/packages/lachezargrigorov/laravel-closures-container)[ Docs](https://github.com/lachezargrigorov/laravel-closures-container)[ RSS](/packages/lachezargrigorov-laravel-closures-container/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Simple closures container for Laravel.
======================================

[](#simple-closures-container-for-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/9d76a47e554b6387448dc0f359595d6088b67db55ff7274bf349afeffa40d55b/68747470733a2f2f706f7365722e707567782e6f72672f6c616368657a6172677269676f726f762f6c61726176656c2d636c6f73757265732d636f6e7461696e65722f762f737461626c65)](https://packagist.org/packages/lachezargrigorov/laravel-closures-container)[![Latest Unstable Version](https://camo.githubusercontent.com/83badc313e3ab4d80f8da81c37d3ce60ed34a769c63b28c219a89312a32dee9e/68747470733a2f2f706f7365722e707567782e6f72672f6c616368657a6172677269676f726f762f6c61726176656c2d636c6f73757265732d636f6e7461696e65722f762f756e737461626c65)](https://packagist.org/packages/lachezargrigorov/laravel-closures-container)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/2b7a6714de2cdb220fab6a5af1d26c0b8930d848644cbdcb58ec9515ab30b2c6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c616368657a6172677269676f726f762f6c61726176656c2d636c6f73757265732d636f6e7461696e65722f6d61737465722e737667)](https://travis-ci.org/lachezargrigorov/laravel-closures-container)[![Total Downloads](https://camo.githubusercontent.com/af67d378130a38ffccf24ba6ea3baaff79d6759a5b089b8af06ef039a0f9c720/68747470733a2f2f706f7365722e707567782e6f72672f6c616368657a6172677269676f726f762f6c61726176656c2d636c6f73757265732d636f6e7461696e65722f646f776e6c6f616473)](https://packagist.org/packages/lachezargrigorov/laravel-closures-container)

Easy to use closures container. First register the closure then use it anywhere.

Install
-------

[](#install)

Via Composer

```
$ composer require lachezargrigorov\laravel-closures-container
```

If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php:

```
Lachezargrigorov\ClosuresContainer\ClosuresContainerServiceProvider::class,
```

If you do not run Laravel 5.5 and want to use the facade, add this to your aliases in app.php:

```
"Closures" => Lachezargrigorov\ClosuresContainer\Facades\Facade::class,
```

Usage
-----

[](#usage)

```
//using Facades

Closures::register("sumTwoNumbers",function($a,$b)
{
return $a + $b;
});

$sum = Closures::sumTwoNumbers(1,2); //3

$bool = Closures::isRegistered("sumTwoNumbers");

//using IOC

$closures = app("closures");

$closures->register("sumTwoNumbers",function($a,$b)
{
return $a + $b;
});

$sum = $closures->sumTwoNumbers(1,2); //3

$bool = $closures->isRegistered("sumTwoNumbers");
```

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

[](#change-log)

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

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) , [ISSUE\_TEMPLATE](ISSUE_TEMPLATE.md) and [PULL\_REQUEST\_TEMPLATE](PULL_REQUEST_TEMPLATE.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Lachezar Grigorov](http://grigorov.website)

License
-------

[](#license)

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

###  Health Score

25

—

LowBetter than 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

3081d ago

### Community

Maintainers

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

---

Top Contributors

[![la40](https://avatars.githubusercontent.com/u/3510976?v=4)](https://github.com/la40 "la40 (2 commits)")

---

Tags

laravelclosuresclosures container

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lachezargrigorov-laravel-closures-container/health.svg)

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

###  Alternatives

[baril/bonsai

An implementation of the Closure Tables pattern for Eloquent.

3592.6k](/packages/baril-bonsai)

PHPackages © 2026

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