morilog / InfinityCache by morilog

Infinity cache for Laravel Eloquent models and queries
15,706
31
5
Package Data
Maintainer Username: morilog
Maintainer Contact: m.parvini@outlook.com (Morteza Parvini)
Package Create Date: 2015-09-18
Package Last Update: 2016-02-21
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-04-19 15:03:31
Package Statistics
Total Downloads: 15,706
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 31
Total Watchers: 5
Total Forks: 7
Total Open Issues: 1

InfinityCache

A Laravel package for Eloquent cache. InfinityCache provides infinity and forever cache for queries results until the model changes. If a model has been created, deleted or updated, model queries caches will be flushed.

Requirements

This package works only with taggable cache storages and drivers such as memcached or Redis and other storages that extended from Illuminate\Cache\TaggedCache.

Installation

To install this package run this composer command:

composer require morilog/infinity-cache

Add the ServiceProvider to your config/app.php providers array:

    'providers' => [
        ...
        Morilog\InfinityCache\InfinityCacheServiceProvider::class,
        ...
    ]

Then publish the config file:

php artisan vendor:publish --provider="Morilog\InfinityCache\InfinityCacheServiceProvider" --tag="config"

Usage

For using InfinityCache, your eloquent model must extend Morilog\InfinityCache\Model

example:

<?php
namespace App\Models;

use Morilog\InfinityCache\Model as InfinityCacheModel;

class Post extends InfinityCacheModel
{
  ...
}