PHPackages                             kamnev/laravel-redis-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. kamnev/laravel-redis-helper

ActiveLibrary[Caching](/categories/caching)

kamnev/laravel-redis-helper
===========================

Laravel Redis Helper package of Predis\\Predis

41.8k↓90%PHP

Since Jun 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kamnev8823/laravel-redis-helper)[ Packagist](https://packagist.org/packages/kamnev/laravel-redis-helper)[ RSS](/packages/kamnev-laravel-redis-helper/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

laravel-redis-helper
====================

[](#laravel-redis-helper)

Laravel Redis Helper package of Predis\\Predis

### Use Redis more effectively with Laravel!

[](#use-redis-more-effectively-with-laravel)

---

Installation
------------

[](#installation)

```
  composer require kamnev/laravel-redis-helper
```

### Laravel

[](#laravel)

Add from .env redis settings

```
  REDIS_HOST=your_redis_host
  REDIS_PASSWORD=your_redis_password
  REDIS_PORT=your_redis_port
  REDIS_CLIENT=predis
```

---

### Lumen

[](#lumen)

Add from .env redis settings

```
  REDIS_HOST=your_redis_host
  REDIS_PASSWORD=your_redis_password
  REDIS_PORT=your_redis_port
  REDIS_CLIENT=predis
```

Register it in bootstrap/app.php

```
  $app->register(Illuminate\Redis\RedisServiceProvider::class);
```

---

Usage
-----

[](#usage)

You can now using the Facades:

#### `RedisString` working with strings in Redis:

[](#redisstring-working-with-strings-in-redis)

1. Method `set` takes 4 parameters `set(string $key, string $value, string $option = "KEEPTTL", int $time = 600)``$option` supports a set of options that modify its behavior: "EX" or "EXAT" or "PXAT" or "NX" or "XX" or "KEEPTTL" or "GET".
2. Method `get` have 1 required parameter `key` and 1 optional `decode` if you set json (default = false).

```
  //Set string value in cache
  RedisString::set('products', json_encode(Product::all()), 'EX', 6000);

  //Get decoded products
  RedisString::get('products', true);
```

#### `RedisHash` working with hash in Redis:

[](#redishash-working-with-hash-in-redis)

1. Method `getAll` - get all values of key. If you set models collection in json, then you can decoded passing the second parameter `true` (default = false), the fird parameter convert to array or object StdClass return Collection
2. Method `getAllVal` - get all values.
3. Method `getAllKeys` - get all keys.
4. Method `get` - Get value on key. The first parameter is key, the second parameter is field(maybe model id), the third parameter is decoding json data (default = false).
5. Method `set` - Set the string value of a hash field.
6. Method `del` - Del one or more hash fields. The second parameter can be string or array.

```
  //Get get all values of key
  RedisHash::getAll('products', true, true);

  //Get all values.
  RedisHash::getAllValue('products', true, true);

  //Get all keys.
  RedisHash::getAllKeys('products');

  //Get value on key
  RedisHash::get('products', 2, true, false);

  //Set the string value of a hash field
  RedisHash::set('products', 2, json_encode(Product::find(3)));

  //Del one or more hash fields
  RedisHash::del('products', [1,2,3,4, etc..]));
```

###  Health Score

21

—

LowBetter than 17% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/60c3ad41f0ca0747fae86dd33215818353f5fd38fcb8ae62d38d18f549d40408?d=identicon)[kamnev8823](/maintainers/kamnev8823)

---

Top Contributors

[![kamnev8823](https://avatars.githubusercontent.com/u/64657142?v=4)](https://github.com/kamnev8823 "kamnev8823 (18 commits)")

---

Tags

laravellumenredis

### Embed Badge

![Health badge](/badges/kamnev-laravel-redis-helper/health.svg)

```
[![Health](https://phpackages.com/badges/kamnev-laravel-redis-helper/health.svg)](https://phpackages.com/packages/kamnev-laravel-redis-helper)
```

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[phpfastcache/phpssdb

PHP SSDB Driver for phpFastCache

14736.9k1](/packages/phpfastcache-phpssdb)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
