bazarov392/db-to-redis-events-laravel

Events about data changes from the database to Redis

1.0.1 2023-06-06 13:19 UTC

This package is auto-updated.

Last update: 2024-06-06 15:29:43 UTC


README

Events about data changes from the database to Redis.

  • At the moment, it is only compatible with MySQL and Laravel because it uses models from Laravel.

Installion

Install package

composer require bazarov392/db-to-redis-events-laravel

Use

// app/Providers/AppServiceProvider.php
use Bazarov392\RedisEventsFromDB;

public function boot(): void
{
    RedisEventsFromDB::init();
    // ...
}

Docs

Format message

db_event.{tableName}.{typeEvent}.{idRow}
  • tableName - Table name
  • typeEvent - Type event ( created | updated | deleted )
  • idRow - If the column has a primary key, it will be listed here. If not, it will not be specified, but the JSON of the model will be in the body of the event.