Skip to content

Commit e38fbba

Browse files
authored
fix for laravel 5.4
1 parent a24360a commit e38fbba

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/GoogleServiceProvider.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ class GoogleServiceProvider extends ServiceProvider
1818
*/
1919
public function boot()
2020
{
21-
$this->app['PulkitJalan\Google\Client'] = function ($app) {
22-
return $app['google.api.client'];
23-
};
24-
25-
$this->publishes([
26-
__DIR__.'/config/config.php' => config_path('google.php'),
27-
], 'config');
21+
if (function_exists('config_path')) {
22+
$this->publishes([
23+
__DIR__.'/config/config.php' => config_path('google.php'),
24+
], 'config');
25+
}
2826
}
2927

3028
/**
@@ -36,8 +34,8 @@ public function register()
3634
{
3735
$this->mergeConfigFrom(__DIR__.'/config/config.php', 'google');
3836

39-
$this->app['google.api.client'] = $this->app->share(function () {
40-
return new Client(config('google'));
37+
$this->app->singleton('PulkitJalan\Google\Client', function ($app) {
38+
return new Client($app['config']['google']);
4139
});
4240
}
4341

@@ -48,6 +46,6 @@ public function register()
4846
*/
4947
public function provides()
5048
{
51-
return ['google.api.client', 'PulkitJalan\Google\Client'];
49+
return ['PulkitJalan\Google\Client'];
5250
}
5351
}

0 commit comments

Comments
 (0)