lachezargrigorov/laravel-closures-container
Composer 安装命令:
composer require lachezargrigorov/laravel-closures-container
包简介
Easy to use closures container for Laravel. First register the closure then use it anywhere.
README 文档
README
Easy to use closures container. First register the closure then use it anywhere.
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
//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
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING , ISSUE_TEMPLATE and PULL_REQUEST_TEMPLATE for details.
Security
If you discover any security related issues, please email lachezar@grigorov.website instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-13