Download the PHP package ryangjchandler/blade-cache-directive without Composer
On this page you can find all versions of the php package ryangjchandler/blade-cache-directive. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ryangjchandler/blade-cache-directive
More information about ryangjchandler/blade-cache-directive
Files in ryangjchandler/blade-cache-directive
Package blade-cache-directive
Short Description Cache chunks of your Blade markup with ease.
License MIT
Homepage https://github.com/ryangjchandler/blade-cache-directive
Informations about the package blade-cache-directive
Blade Cache Directive
Cache chunks of your Blade markup with ease.
Installation
You can install the package via Composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
This package adds a new @cache
Blade directive. It accepts 2 arguments - the cache key and a TTL.
When used inside of a Blade template, the content between the 2 directives will be cached using Laravel's application cache. If a TTL (in seconds) isn't provided, the default TTL of 1 hour will be used instead.
If you want to cache the content for a particular model, i.e. a User
model, you can use string interpolation to change the key.
When a new user is passed to this view, a separate cache entry will be created.
Disabling caching
If you wish to disable caching when using the @cache
directive (useful for local development and testing), you can set the BLADE_CACHE_DIRECTIVE_ENABLED
environment variable to false
.
Alternatively, publish the configuration file and modify the enabled
entry accordingly.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Ryan Chandler
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of blade-cache-directive with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0