@@ -25,30 +25,27 @@ public function boot()
25
25
"config "
26
26
);
27
27
$ this ->mergeConfigFrom ($ configPath , "geocoder " );
28
-
29
- $ providerAndDumperAggregator = (new ProviderAndDumperAggregator )
28
+ $ geocoder = (new ProviderAndDumperAggregator )
30
29
->registerProvidersFromConfig (collect (config ("geocoder.providers " )));
31
-
32
- $ this ->app ->singleton ("geocoder " , function ($ app ) use ($ providerAndDumperAggregator ) {
33
- return $ providerAndDumperAggregator ;
34
- });
35
-
36
- // Resolve dependency via class name
37
- // i.e app(ProviderAndDumperAggregator::class) or _construct(ProviderAndDumperAggregator $geocoder)
38
- $ this ->app ->instance (ProviderAndDumperAggregator::class, $ providerAndDumperAggregator );
30
+ $ this ->app
31
+ ->singleton ("geocoder " , function () use ($ geocoder ) {
32
+ return $ geocoder ;
33
+ });
34
+ $ this ->app
35
+ ->instance (ProviderAndDumperAggregator::class, $ geocoder );
39
36
}
40
37
41
38
public function register ()
42
39
{
43
40
$ this ->app ->alias ("Geocoder " , Geocoder::class);
44
41
}
45
42
46
- public function provides (): array
43
+ public function provides () : array
47
44
{
48
- return ["geocoder " ];
45
+ return ["geocoder " , ProviderAndDumperAggregator::class ];
49
46
}
50
47
51
- protected function configPath (string $ path = "" ): string
48
+ protected function configPath (string $ path = "" ) : string
52
49
{
53
50
if (function_exists ("config_path " )) {
54
51
return config_path ($ path );
0 commit comments