Skip to content

Commit

Permalink
Add service provider
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperLaiTW committed Dec 13, 2018
1 parent ddfb492 commit ce5128c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,12 @@
"psr-4": {
"Voh\\KmSocialite\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Voh\\KmSocialite\\KmSocialiteServiceProvider"
]
}
}
}
27 changes: 27 additions & 0 deletions src/KmSocialiteServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Voh\KmSocialite;

use Illuminate\Support\ServiceProvider;
use Laravel\Socialite\Contracts\Factory;

/**
* Class KmSocialiteServiceProvider
*
* @package Voh\KmSocialite
*/
class KmSocialiteServiceProvider extends ServiceProvider
{
/**
*
*/
public function boot()
{
$socialite = $this->app->make(Factory::class);
$socialite->extend('km', function ($app) use ($socialite) {
$config = $app['config']['services.km'];

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

0 comments on commit ce5128c

Please sign in to comment.