PHP code example of grummfy / stathat-read

1. Go to this page and download the library: Download grummfy/stathat-read 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/ */

    

grummfy / stathat-read example snippets


use Grummfy\StatHat;
use Grummfy\Stathat\HTTPAdapter\GuzzleAdapter;
use GuzzleHttp\Client;

$stathatToken = 'ABC123'; // get it from https://www.stathat.com/access

$adapter = new GuzzleAdapter($client);
$stathat = new Grummfy\StatHat($adapter, $stathatToken);
var_dump($stathat->listAllStats());