PHP code example of theriddleofenigma / laravel-rache
1. Go to this page and download the library: Download theriddleofenigma/laravel-rache 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/ */
theriddleofenigma / laravel-rache example snippets
// Service provider
$app->register(\Rache\RacheServiceProvider::class);
// Alias
$app->alias('Rache', \Rache\Facades\Rache::class);
/**
* Get the tag details of this rache tag.
*
* @return array
*/
public function getTagDetails(): array
{
return [
'search' => $this->request->input('search'),
];
}
/*
* You may declare the tags here. All responses will be tagged.
* These tags are very used while forgetting the response cache.
*/
'tags' => [
'auth' => \Rache\Tags\Auth::class, // Added by default
'page' => \Rache\Tags\Pagination::class, // Added by default
'request' => \Rache\Tags\Request::class, // Added by default
// Custom tags
'search' => \App\Rache\Tags\Search::class, // Newly added
],
// Both acts as same.
rache:ttl_10,auth,page,search
rache:auth,ttl_10,search,page