PHP code example of jakebooy2 / discord-provider

1. Go to this page and download the library: Download jakebooy2/discord-provider 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/ */

    

jakebooy2 / discord-provider example snippets


'providers' => [
    // a whole bunch of providers
    // remove 'Laravel\Socialite\SocialiteServiceProvider',
    \SocialiteProviders\Manager\ServiceProvider::class, // add
];

/**
 * The event handler mappings for the application.
 *
 * @var array
 */
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // add your listeners (aka providers) here
        'Jakebooy\\DiscordProvider\\DiscordExtendSocialite@handle',
    ],
];

use Socialite;

public function login(){
  return Socialite::with('discord')->redirect();
}
public function confirm(){
  $user = Socialite::driver('discord')->user();
  //
}