PHP code example of wowe / laravel-response-cache

1. Go to this page and download the library: Download wowe/laravel-response-cache 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/ */

    

wowe / laravel-response-cache example snippets


// No value
Route::get('foo', ['FooController@getFoo', 'cache']);

// True
Route::get('bar', ['FooController@getBar', 'cache' => true]);

// Integer, will cache for 90 minutes
Route::get('baz', ['FooController@getBaz', 'cache' => 90]);

// Group
Route::group(['cache'], function () {
    Route::get('qux', 'FooController@getQux');
});

// No value
Route::get('foo', ['FooController@getFoo', 'no-cache']);

// False
Route::get('bar', ['FooController@getBar', 'cache' => false]);

// Group
Route::group(['no-cache'], function () {
    Route::get('qux', 'FooController@getQux');
});