PHP code example of bulldog / cf-firewall-events

1. Go to this page and download the library: Download bulldog/cf-firewall-events 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/ */

    

bulldog / cf-firewall-events example snippets



zle = new \GuzzleHttp\Client([
    'base_uri' => 'https://api.cloudflare.com/client/v4/',
    'headers' => [
        'X-Auth-Key' => '',
        'X-Auth-Email' => ''
    ]
]);

$fw = new \Bulldog\Cloudflare\Firewall($guzzle);
$events = $fw->events('zoneid');

$logs = $events->getBody()->getContents();


zle = new \GuzzleHttp\Client([
    'base_uri' => 'https://api.cloudflare.com/client/v4/',
    'headers' => [
        'X-Auth-Key' => '',
        'X-Auth-Email' => ''
    ]
]);

$fw = new \Bulldog\Cloudflare\Firewall($guzzle);
$events = $fw->events('zoneid', [
    'limit' => 10,
]);

$logs = $events->getBody()->getContents();