PHP code example of swiss-devjoy / blade-staticcache-directive
1. Go to this page and download the library: Download swiss-devjoy/blade-staticcache-directive 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/ */
swiss-devjoy / blade-staticcache-directive example snippets
return [
'enabled' => env('BLADE_STATICCACHE_DIRECTIVE_ENABLED', true),
// Cache profile which generates the unique key for the cache entry
'cache_profile' => \SwissDevjoy\BladeStaticcacheDirective\CacheProfile::class,
];
// bootstrap/app.php
->withMiddleware(function (Middleware $middleware) {
...
$middleware->web(append: [
...
\SwissDevjoy\BladeStaticcacheDirective\BladeStaticcacheStatsMiddleware::class,
]);
})
// app/Http/Kernel.php
...
protected $middlewareGroups = [
'web' => [
...
\SwissDevjoy\BladeStaticcacheDirective\BladeStaticcacheStatsMiddleware::class,
],
bash
php artisan vendor:publish --tag="blade-staticcache-directive-config"
bash
$ php artisan blade-staticcache:clear