anorgan / laravel-cache
Laravel Cache package that supports tagging
v0.10.1
2017-10-11 11:18 UTC
Requires
- php: ^7.0
- illuminate/contracts: ~5.2.0|~5.3.0|~5.4.0
- illuminate/support: ~5.2.0|~5.3.0|~5.4.0
- kargnas/alternative-laravel-cache: 0.1
- spatie/laravel-fractal: ^2.0|^3.0|^4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.1
- phpunit/phpunit: ^6.0
- roave/security-advisories: dev-master
This package is not auto-updated.
Last update: 2024-12-21 22:02:18 UTC
README
This package aims to help with caching of models by tagging them and invalidating caches on model change.
Installation
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' ] ], ];
Testing
You can run the tests with:
$ vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.