Download the PHP package athwari/laravel-method-cache without Composer
On this page you can find all versions of the php package athwari/laravel-method-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download athwari/laravel-method-cache
More information about athwari/laravel-method-cache
Files in athwari/laravel-method-cache
Package laravel-method-cache
Short Description Attribute-based method caching for Laravel using method overriding proxy system
License MIT
Homepage https://github.com/athwari/laravel-method-cache
Informations about the package laravel-method-cache
Laravel Method Cache
Attribute-based method caching for Laravel applications using method overriding proxy system.
This package allows you to cache method results by annotating them with attributes, automatically intercepting calls to store and retrieve cached results.
Installation
Install the package with Composer:
Laravel package auto-discovery is supported, so the service provider and facade are registered automatically.
Configuration
Publish the configuration file:
The published config file is located at config/method-cache.php.
Default configuration
Usage
Annotate methods with the #[Cacheable] attribute to enable caching.
Basic caching
Custom key and tags
Conditional caching
Cache invalidation
Use the facade to flush caches:
Or use the console command:
Attributes
#[Cacheable]: Main caching attribute#[NoCache]: Skip caching for specific methods#[CacheableUntil]: Cache until a specific time
Exceptions
The package may throw exceptions related to caching or method overriding.
Testing
Run the test suite with Pest:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- athwari
- All Contributors
License
The package is open-source software licensed under the MIT License. Please see License File for more information.
All versions of laravel-method-cache with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/cache Version ^11.0|^12.0
athwari/laravel-method-overrider Version ^1.0.0