PHP code example of bagisto / bagisto-varnish

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


'providers' => [
    Webkul\Varnish\Providers\VarnishServiceProvider::class,
],

return [
    'esi' => [
        'views' => [
            ...

            'customer-desktop-dropdown' => 'varnish::shop.components.layouts.header.desktop.customer-dropdown',

            ...
        ]
    ],
];

Route::get('/', [HomeController::class, 'index'])
    ->name('shop.home.index')
    ->middleware('cache.response');

VarnishCache::forget($urls);
bash
php artisan vendor:publish --provider="Webkul\Varnish\Providers\VarnishServiceProvider"