Skip to content

Laravel UrnCache provides a cache system with grouping ability.

Notifications You must be signed in to change notification settings

rjz1371/UrnCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 taylor@laravel.com. All security vulnerabilities will be promptly addressed.

License

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

About

Laravel UrnCache provides a cache system with grouping ability.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages