PHP code example of illuma-law / laravel-edge-clear

1. Go to this page and download the library: Download illuma-law/laravel-edge-clear 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/ */

    

illuma-law / laravel-edge-clear example snippets


use IllumaLaw\EdgeClear\Facades\CloudflarePurger;

CloudflarePurger::purgeByUrls([
    'https://example.com/posts/hello',
    'https://example.com/posts',
]);

CloudflarePurger::purgeByTags(['posts', 'news']);
CloudflarePurger::purgeEverything();

use IllumaLaw\EdgeClear\Middleware\BypassEdgeCache;
use IllumaLaw\EdgeClear\Middleware\SetEdgeCacheHeaders;

Route::get('/posts', PostsController::class)
    ->middleware(SetEdgeCacheHeaders::class.':600;posts');

Route::get('/account', AccountController::class)
    ->middleware(BypassEdgeCache::class);