104lab/laravel-redis

The helper for Laravel Redis package

dev-master 2024-07-20 07:58 UTC

This package is auto-updated.

Last update: 2024-12-20 08:54:56 UTC


README

tests

Requirement

  • PHP 8.1 ~ 8.3
  • Laravel 10 ~ 11
  • ext-redis 5.3 ~ 6.0 (Test covered)
  • Redis 6 ~ 7 (Test covered)

Installation

Use Composer for install.

composer require 104lab/laravel-redis

Usage

Redis KEYS method is like full-table scan, so maybe use SCAN is good idea.

$connection = Redis::connection();

# Before
$keys = $connection->keys('foo:*');

# After
$keys = (new KeysByScan($connection))('foo:*');

# Use chunk limit
$keys = (new KeysByScan($connection))('foo:*', 100);

License

The MIT License (MIT). Please see License File for more information.