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.7k↓25%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 1mo 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

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

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

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

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