Skip to content

Commit

Permalink
Version 1.1.2 - Laravel Socialite is now really optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian de Laender committed May 18, 2016
1 parent b6c0f78 commit 8800edc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mollie/laravel-mollie",
"description": "Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite",
"version": "1.1.1",
"version": "1.1.2",
"homepage": "https://github.com/mollie/laravel-mollie",
"license": "BSD-2-Clause",
"authors": [
Expand All @@ -18,8 +18,10 @@
"require": {
"illuminate/contracts": "5.0.*|5.1.*|5.2.*",
"illuminate/support": "5.0.*|5.1.*|5.2.*",
"mollie/mollie-api-php": "~1.0",
"laravel/socialite": "~2.0"
"mollie/mollie-api-php": "~1.0"
},
"suggest": {
"laravel/socialite": "Use Mollie Connect (OAuth) to authenticate via Laravel Socialite with the Mollie API. This is needed for some endpoints."
},
"autoload": {
"psr-4": {
Expand Down
14 changes: 8 additions & 6 deletions src/MollieServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,19 @@ protected function setupConfig()
}

/**
* Extend the Laravel Socialite factory class.
* Extend the Laravel Socialite factory class, if available.
*/
protected function extendSocialite()
{
$socialite = $this->app->make('Laravel\Socialite\Contracts\Factory');
if (class_exists('Laravel\Socialite\Contracts\Factory')) {
$socialite = $this->app->make('Laravel\Socialite\Contracts\Factory');

$socialite->extend('mollie', function (Container $app) use ($socialite) {
$config = $app['config']['services.mollie'];
$socialite->extend('mollie', function (Container $app) use ($socialite) {
$config = $app['config']['services.mollie'];

return $socialite->buildProvider(MollieConnectProvider::class, $config);
});
return $socialite->buildProvider(MollieConnectProvider::class, $config);
});
}
}

/**
Expand Down

0 comments on commit 8800edc

Please sign in to comment.