Skip to content

Commit

Permalink
fix for laravel 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkitjalan authored Jan 29, 2017
1 parent a24360a commit e38fbba
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/GoogleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ class GoogleServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->app['PulkitJalan\Google\Client'] = function ($app) {
return $app['google.api.client'];
};

$this->publishes([
__DIR__.'/config/config.php' => config_path('google.php'),
], 'config');
if (function_exists('config_path')) {
$this->publishes([
__DIR__.'/config/config.php' => config_path('google.php'),
], 'config');
}
}

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

$this->app['google.api.client'] = $this->app->share(function () {
return new Client(config('google'));
$this->app->singleton('PulkitJalan\Google\Client', function ($app) {
return new Client($app['config']['google']);
});
}

Expand All @@ -48,6 +46,6 @@ public function register()
*/
public function provides()
{
return ['google.api.client', 'PulkitJalan\Google\Client'];
return ['PulkitJalan\Google\Client'];
}
}

0 comments on commit e38fbba

Please sign in to comment.