morilog / infinity-cache
Infinity cache for Laravel Eloquent models and queries
Installs: 15 717
Dependents: 0
Suggesters: 0
Security: 0
Stars: 31
Watchers: 5
Forks: 7
Open Issues: 1
Requires
- illuminate/cache: ^5.1
- illuminate/database: ^5.1
- illuminate/support: ^5.1
Requires (Dev)
- mockery/mockery: ^0.9.4
- phpunit/phpunit: ^4.8
This package is auto-updated.
Last update: 2024-09-21 04:07:45 UTC
README
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 { ... }