LaravelPackages.net
Acme Inc.
Toggle sidebar
rjz1371/urncache

Laravel UrnCache provides a cache system with grouping ability.

3
4
v0.0.2
About rjz1371/urncache

rjz1371/urncache is a Laravel package for laravel urncache provides a cache system with grouping ability.. It currently has 4 GitHub stars and 3 downloads on Packagist (latest version v0.0.2). Install it with composer require rjz1371/urncache. Discover more Laravel packages by rjz1371 or browse all Laravel packages to compare alternatives.

Last updated

Build Status Total Downloads Latest Stable Version License

About UrnCache

Laravel UrnCache provides a cache system with grouping ability.

Quick Start

installation

composer require rjz1371/urncache
composer update

namespace

use rjz1371\UrnCache\UrnCache;

Put cache data without expire time ( forever cache ).

$key = 'my-cache-key';
$value = [
    ['username' => 'rjz1371', 'age' => 25],
    ['username' => 'reza', 'age' => 20],
    ['username' => 'alex', 'age' => 56]
];
$group = 'users';
UrnCache::put($key, $value, $group);

Put cache data with expire time ( expire after 1 hour ).

$key = 'my-cache-key';
$value = [
    ['username' => 'rjz1371', 'age' => 25],
    ['username' => 'reza', 'age' => 20],
    ['username' => 'alex', 'age' => 56]
];
$group = 'users';
UrnCache::put($key, $value, $group, 3600);

Checking cache exists or not ( $result is true or false ).

$key = 'my-cache-key';
$group = 'users';
$result = UrnCache::has($key, $group);

Retrive cache data.

$key = 'my-cache-key';
$group = 'users';
$result = UrnCache::get($key, $group);

Delete cache.

$key = 'my-cache-key';
$group = 'users';
UrnCache::delete($key, $group);

Delete all cache in special group.

$group = 'users';
UrnCache::deleteByGroup($group);

Delete all cache.

UrnCache::deleteAll();

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [email protected]. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

Star History Chart