PHP code example of abenevaut / laravel-twitch-client

1. Go to this page and download the library: Download abenevaut/laravel-twitch-client 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/ */

    

abenevaut / laravel-twitch-client example snippets


'twitch' => [
    'oauthBaseUrl' => env('TWITCH_OAUTH_URL', 'https://id.twitch.tv/oauth2/token'), // Twitch OAuth URL
    'baseUrl' => env('TWITCH_URL', 'https://api.twitch.tv/helix'), // Twitch API URL
    'client_id' => env('TWITCH_CLIENT_ID'), // Your Twitch client id
    'client_secret' => env('TWITCH_CLIENT_SECRET'), // Your Twitch client secret
    'debug' => env('TWITCH_DEBUG', false), // Debug mode
],

use Abenevaut\Twitch\Facades\Twitch;

Twitch::getClient(): TwitchClient; // Get the Twitch client
Twitch::countFollowers(string $broadcaster): int; // Get the number of followers of an account, like abenevaut