2017 © Pedro Peláez
 

library socialite-battlenet

BattleNet OAuth2 Provider for Laravel Socialite

image

team-reflex/socialite-battlenet

BattleNet OAuth2 Provider for Laravel Socialite

  • Wednesday, July 26, 2017
  • by Kairu
  • Repository
  • 2 Watchers
  • 2 Stars
  • 8,111 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

Socialite-BattleNet

BattleNet provider for Laravel Socialite/Socialite Providers., (*1)

Deprecated: Socialite Providers has had a BattleNet provider for a while now. This package was made before it existed, and is no longer necessary., (*2)

Install

Composer:, (*3)

composer install team-reflex/socialite-battlenet, (*4)

Same procedure as any other SocialiteProviders package. Add the event handler to the Socialite Providers array:, (*5)

'Reflex\SocialiteProviders\BattleNet\BattleNetExtendSocialite@handle',

Place your environment variables in your .env.:, (*6)

BATTLENET_KEY=client_id
BATTLENET_SECRET=client_secret
BATTLENET_REDIRECT_URI=https://example.com/login 

Now you have two options when using the provider., (*7)

Usage (Socialite-way)

Now you can use the provider like so. The session flashing is only required if you need to use a BattleNet region other than us:, (*8)

// redirect route
Session::put('bnet.region', 'eu');
return Socialite::with('battlenet')->redirect();

// callback route
$user = Socialite::driver('battlenet')->user();
$accountId = $user->getId(); // bnet accountId
$battletag = $user->getNickname(); // bnet battletag

Usage (Laravel-way)

If you'd like to avoid flashing to the session yourself, you can use the included facade that manages it for you., (*9)

Install service provider:, (*10)

Reflex\SocialiteProviders\BattleNet\BattleNetServiceProvider::class,

Install facade:, (*11)

'BattleNet' => Reflex\SocialiteProviders\BattleNet\BattleNetFacade::class,

Now you can simply use the facade. The region defaults to us, so you don't even need to pass it through:, (*12)

// redirect route
return BattleNet::redirect('eu');

The Versions

26/07 2017

dev-master

9999999-dev

BattleNet OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires

 

26/07 2017

v1.0.4

1.0.4.0

BattleNet OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires

 

26/01 2017

v1.0.3

1.0.3.0

BattleNet OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires

 

29/10 2016

v1.0.2

1.0.2.0

BattleNet OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires

 

17/06 2016

v1.0.1

1.0.1.0

BattleNet OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires

 

17/06 2016

v1.0

1.0.0.0

BattleNet OAuth2 Provider for Laravel Socialite

  Sources   Download

MIT

The Requires