Skip to content

jhavenz/laravel-redis-scanner

Repository files navigation

Laravel Redis Scanner

A simple package to iterate over Redis data without having to write out the manual looping logic every time.

Note: So far, this is just an idea for a package I've put together. It's not production ready

Installation

You can install the package via composer:

composer require jhavenz/laravel-redis-scanner

You can publish the config file with:

php artisan vendor:publish --tag="laravel-redis-scanner-config"

This is the contents of the published config file:

return [
    'connection' => env('REDIS_SCANNER_CONNECTION', 'default'),
];

Usage

use Jhavenz\LaravelRedisScanner\Facades\RedisScanner;
use Jhavenz\LaravelRedisScanner\ScannedValue;

// Scan a redis pattern and match the results 
$users = collect(RedisScanner::scan(pattern: 'users:*', count: 100))
    ->map(fn(ScannedValue $s) => $s->redisValue());

Testing

composer test

Credits

License

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

About

simplified redis scans

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages