Skip to content

Commit

Permalink
Merge branch 'release/4.0.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebronner committed Jul 1, 2018
2 parents fd0c837 + 374cc05 commit b0a0a15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [4.0.10] - 1 Jul 2018
### Changed
- service provider to register singleton and alias in `register()` method.

## [4.0.9] - 28 May 2018
### Added
- class-name resolution from Service container, allowing for dependency
Expand Down
13 changes: 5 additions & 8 deletions src/Providers/GeocoderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,16 @@ public function boot()
"config"
);
$this->mergeConfigFrom($configPath, "geocoder");
$geocoder = (new ProviderAndDumperAggregator)
->registerProvidersFromConfig(collect(config("geocoder.providers")));
$this->app
->singleton("geocoder", function () use ($geocoder) {
return $geocoder;
});
$this->app
->instance(ProviderAndDumperAggregator::class, $geocoder);
}

public function register()
{
$this->app->alias("Geocoder", Geocoder::class);
$this->app->singleton(ProviderAndDumperAggregator::class, function () {
return (new ProviderAndDumperAggregator)
->registerProvidersFromConfig(collect(config("geocoder.providers")));
});
$this->app->bind('geocoder', ProviderAndDumperAggregator::class);
}

public function provides() : array
Expand Down

0 comments on commit b0a0a15

Please sign in to comment.