2017 © Pedro PelĆ”ez
 

library laravel-cache

Laravel Cache package that supports tagging

image

anorgan/laravel-cache

Laravel Cache package that supports tagging

  • Wednesday, October 11, 2017
  • by anorgan
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Cache models by tagging

Latest Version Quality Score Build Status GitHub license, (*1)

This package aims to help with caching of models by tagging them and invalidating caches on model change., (*2)

Installation

Install this package via composer by running:, (*3)

composer require anorgan/laravel-cache:^1.0

Add to providers:, (*4)

// config/app.php
'providers' => [
    ...
    Anorgan\LaravelCache\LaravelCacheServiceProvider::class
];

To publish the config, run:, (*5)

php artisan vendor:publish --provider="Anorgan\LaravelCache\LaravelCacheServiceProvider" --tag="config"

Config looks like this:, (*6)

<?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:, (*7)

$ vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details., (*8)

License

The MIT License (MIT). Please see License File for more information., (*9)

The Versions