PHP code example of team-reflex / socialite-battlenet

1. Go to this page and download the library: Download team-reflex/socialite-battlenet library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

team-reflex / socialite-battlenet example snippets


// 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