anorgan/laravel-cache is a Laravel package for laravel cache package that supports tagging.
It currently has 3 GitHub stars and 16 downloads on Packagist (latest version v0.10.1).
Install it with composer require anorgan/laravel-cache.
Discover more Laravel packages by anorgan
or browse all Laravel packages to compare alternatives.
Last updated
This package aims to help with caching of models by tagging them and invalidating caches on model change.
Install this package via composer by running:
composer require anorgan/laravel-cache:^1.0
Add to providers:
// config/app.php
'providers' => [
...
Anorgan\LaravelCache\LaravelCacheServiceProvider::class
];
To publish the config, run:
php artisan vendor:publish --provider="Anorgan\LaravelCache\LaravelCacheServiceProvider" --tag="config"
Config looks like this:
<?php
return [
/*
* Add keys per model which should be invalidated alongside default model key and tags,
* e.g. for Product::class, you would like to invalidate cache with key "product_listing"
*/
'invalidate' => [
\App\Product::class => [
'product_listing'
]
],
];
You can run the tests with:
$ vendor/bin/phpunit
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.