PHP code example of erashdan / laravelfastly

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

    

erashdan / laravelfastly example snippets


Fastly::purgeUrl('get-url')

Fastly::purgeUrl(['first-url', 'second-url'])

'services' => [
    'main' => 'xDp52XsJ5dXLp',
]

Fastly::purgeService('main');

Fastly::callUrl('https://erashdan.com');

Fastly::purgeAndCall('https://erashdan.com');
bash
php artisan vendor:publish --provider="Erashdan\LaravelFastly\FastlyServiceProvider" --tag="config"