New

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

microweber-packages/laravel-tagged-file-cache

Taggable File Cache driver for Laravel. Allows the use of Cache tags with a file cache.
1,252 1
Install
composer require microweber-packages/laravel-tagged-file-cache
Latest Version:0.1.4
License:MIT
Last Updated:Sep 23, 2020
Links: GitHub  ·  Packagist
Maintainer: boksiora

Laravel Taggable File Cache Build Status

https://travis-ci.org/microweber-packages/laravel-tagged-file-cache

This package provides a custom file cache driver that supports Cache Tags for Laravel 6.x

Usage

This product is publicly available under the terms of the MIT license included in this repository.

Installation and Requirements

First, you'll need to require the package with Composer:

composer require microweber-packages/laravel-tagged-file-cache

Then, update config/app.php by adding an entry for the service provider.

'providers' => [
    // ...
    MicroweberPackages\Cache\TaggableFileCacheServiceProvider::class
];

Finally, add the necessary config to config\cache.php.

'default' => env('CACHE_DRIVER', 'file'),

'stores' => [

		'file' => [
			'driver' => 'file',
			'path'   => storage_path('framework/cache')
		],
		// ...
],

You are ready to use tag file caching..

$minutes = 1111 * 4;
$tags = ['people', 'cars', 'shamans'];
Cache::tags($tags)->put('name', 'John', $minutes);

$name = Cache::tags($tags)->get('name');
var_dump($name); // Output: John

// If you want to delete tags
Cache::tags($tags)->flush();

Optional Configuration

There are some optional config options available in the store definition above:

separator : defines the separator character or sequence to be used internally, this should be chosen to never collide with a key value. defaults to --- if omitted.

Related Packages

doctrine/dbal

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

660,512,042 9,702
laravel/framework

The Laravel Framework.

617,629,957 34,997
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.

418,503,470 4,663

Version History

Version Released License
0.1.4 MIT
0.1.3 MIT