1. Go to this page and download the library: Download bagisto/bagisto-varnish 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/ */
bagisto / bagisto-varnish example snippets
use Webkul\Varnish\Providers\VarnishServiceProvider;
// ...other Webkul providers
return [
// ...other Webkul providers
VarnishServiceProvider::class, // ← must be LAST
];
use Webkul\Varnish\Facades\VarnishCache;
VarnishCache::forget('/some-path'); // one page, every variant
VarnishCache::forget(['/a', '/b']); // several
VarnishCache::flush(); // everything