PHP code example of justbetter / statamic-cloudflare-purge

1. Go to this page and download the library: Download justbetter/statamic-cloudflare-purge 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/ */

    

justbetter / statamic-cloudflare-purge example snippets


Schedule::job(\JustBetter\StatamicCloudflarePurge\Jobs\PurgeCloudflareCachesJob::class)->everyFiveSeconds()->withoutOverlapping();

// Single zone
'zone' => 'zone_id',

// Multiple zones based on statamic site handles
'zone' => [
    'default' => 'zone_id_default',
    'french' => 'zone_id_french',
    ...
],

// Complete freedom with a callback
'zone' => function() {
    return \App\Facades\Custom::getCloudflareZone()
},

'flush-events' => [
    \Statamic\Events\GlobalSetSaved::class,
    \Statamic\Events\NavSaved::class,
    \Statamic\Events\StaticCacheCleared::class,
],
sh
php artisan vendor:publish --provider="JustBetter\StatamicCloudflarePurge\StatamicCloudflarePurgeServiceProvider"