Cache Purge
Usage
Cloudflare API provides extensive configuration for Purge Cached Content, this helper aims to simplify it.
php
use Cloudflare\Configurations\Zones\CachePurge;
$cachePurge = new CachePurge();
$cachePurge
->byHosts(['foo.example.com', 'bar.example.com']);
// OR
$cachePurge->everything();
// OR
// byFilesAdvanced can be chained to add multiple files.
$cachePurge
->byFilesAdvanced('https://example.com/my-script.js', 'mobile')
->byFilesAdvanced('https://example.com/my-script2.js', 'desktop');
$response = $client->zones()->purge('zone_id', $cachePurge);