Skip to content

Commit 738aea7

Browse files
Fix late config binding (#5)
* Fix late config binding * Add changelog entry
1 parent 1c9a5b6 commit 738aea7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
- Late config binding added for runtime override
810

911
## [1.1.1] - 2020-07-12
1012
### Fixed
11-
- Make JsonMapperInterface availalbe in ServiceProvider
13+
- Make JsonMapperInterface available in ServiceProvider
1214

1315
## [1.1.0] - 2020-07-12
1416
### Fixed

src/ServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public function register()
2020
{
2121
$this->mergeConfigFrom(self::CONFIG_FILE, 'json-mapper');
2222

23-
$config = config('json-mapper.type');
24-
$this->app->singleton(JsonMapperInterface::class, static function () use ($config) {
23+
$this->app->singleton(JsonMapperInterface::class, function ($app) {
24+
$config = $app->get('config')->get('json-mapper.type');
2525
switch ($config) {
2626
case 'best-fit':
2727
return (new JsonMapperFactory())->bestFit();

0 commit comments

Comments
 (0)