New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

anorgan/laravel-cache

Laravel Cache package that supports tagging
16 3
Install
composer require anorgan/laravel-cache
Latest Version:v0.10.1
PHP:^7.0
Laravel:5
License:MIT
Last Updated:Oct 11, 2017
Links: GitHub  ·  Packagist
Maintainer: anorgan

Cache models by tagging

Latest Version Quality Score Build Status GitHub license

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.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

665,354,487 9,703
laravel/framework

The Laravel Framework.

625,568,548 34,998
laravel/tinker

Powerful REPL for the Laravel framework.

531,591,559 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

450,320,528 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

424,642,029 4,662

Version History

Version Released PHP Laravel License
v0.10.1 ^7.0 ~5.2.0|~5.3.0|~5.4.0 MIT
v0.10.0 ^7.0 ~5.2.0|~5.3.0|~5.4.0 MIT
v0.9.1 ^7.0 ~5.2.0|~5.3.0|~5.4.0 MIT
v0.9.0 ^7.0 ~5.2.0|~5.3.0|~5.4.0 MIT