PHP code example of esemve / vanillacache

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

    

esemve / vanillacache example snippets


Esemve\VanillaCache\CacheServiceProvider::class

'Vanilla' => Esemve\VanillaCache\Facades\Vanilla::class

use \Vanilla;
…

  public function index(RoomRepository $roomRepository)
    {
        $rooms = $roomRepository->getAll();

        return Vanilla::Cache(View::make('cinema.index',[
            'rooms' => $rooms
        ]),10);
    }

'file' => [
	    'laravel' => 'Esemve\\VanillaCache\\Engines\\FileEngine',
	    'vanilla' => __DIR__.'/../vendor/esemve/vanillacache/vanilla/Engines/FileEngine.php',
	    'config' => [
		'storage_folder' => realpath(__DIR__.'/../storage/').'/vanilla/'
	    ]
	]
bash
composer dump-autoload
php artisan vendor:publish
json
"files": ["config/vanilla.php","vendor/esemve/vanillacache/vanilla/CacheServer.php"],