PHP code example of abenevaut / laravel-x-client

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


'x' => [
    'baseUrl' => env('X_URL', 'https://api.x.com/2'), // x API URL
    'client_id' => env('X_CLIENT_ID'), // Your x client id
    'client_secret' => env('X_CLIENT_SECRET'), // Your x client secret
    'debug' => env('X_DEBUG', false), // Debug mode
],

use abenevaut\X\Facades\X;

X::getClient(): XClient; // Get the x client
X::countFollowers(string $account): int; // Get the number of followers of an account, like @abenevaut