al-one/laravel-predis-listened

Listening Laravel pRedis Queries

v1.9.0-beta1 2022-08-04 10:32 UTC

README

Installing

# composer.json

"minimum-stability": "dev",
"prefer-stable": true,
$ composer require "al-one/laravel-predis-listened" -vvv

Usage

# optional if >= 5.5
# config/app.php
<?php

return [

    'providers' => [
        Alone\LaravelPredisListened\ServiceProvider::class,
    ],

];
# config/database.php
<?php

return [
    'redis' => [
        'client' => 'predis_listened',
    ],
];
use Alone\LaravelPredisListened\RedisEvent;

Facades\Event::listen(RedisEvent::class,function(RedisEvent $event)
{
    $event->command;   // Redis命令
    $event->arguments; // 参数
    $event->time;      // 耗时
});

License

MIT