New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

umbrellio/php-table-sync

PHP's implementation of the library providing data synchronization between microservices
52,101 5
Install
composer require umbrellio/php-table-sync
Latest Version:4.0.0
PHP:^8.1
Laravel:10 – 13
Older releases:5 – 9
License:MIT
Last Updated:May 26, 2026
Links: GitHub  ·  Packagist
Maintainer: Zlob

PHP TableSync

PHP's implementation of the library providing data synchronization between microservices

Github Status Coverage Status Latest Stable Version Total Downloads Code Intelligence Status Build Status Code Coverage Scrutinizer Code Quality

Installation

composer require umbrellio/php-table-sync
php artisan vendor:publish --tag=config-table-sync

Usage

Let's describe the model that needs to be synchronized using an example User.php

...
User extends Model implements SyncableModel
{
    use TableSyncable;

...

    public function routingKey(): string
    {
        return 'users';
    }

    public function getTableSyncableAttributes(): array
    {
        return [
            'id' => $this->external_id,
            'login' => $this->name,
            'email' => $this->email,
        ];
    }
...

When the model changes, the data will be sent according to the rules of TableSyncObserver, to get the data you need to run the command table_sync:work

Logging

Logging based on the Monolog package and contains some extensions for it.

  • specify the logging channel in config/table_sync.php
...
'log' => [
    'channel' => 'table_sync',
],
...
  • and describe this channel in config/logging.php
...
'table_sync' => [
    'driver' => 'stack',
    'channels' => ['table_sync_daily', 'influxdb'],
],
'table_sync_daily' => [
    'driver' => 'daily',
    'formatter' => LineTableSyncFormatter::class,
    'formatter_with' => [
        'format' => '[%datetime%] %message% - %model% %event%',
    ],
    'path' => storage_path('logs/table_sync/daily.log'),
],
'influxdb' => [
    'driver' => 'influxdb',
    'measurement' => 'table_sync',
],
...
You can use the built-in LineTableSyncFormatter::class with the available parameters: %datetime% %message% %direction% %model% %event% %routing% %attributes% %exception%
Driver influxdb is an additional option and is not required to add in config
...
'table_sync' => [
    'driver' => 'daily',
],
...

Authors

Created by Korben Dallas.

Supported by Umbrellio

Related Packages

umbrellio/rollback-missing-migrations

Laravel package for rolling back migrations between different releases

47,618 2
bebbolus/edmrabbitpackage

Rabbit Entity Management Package for Laravel PHP Framework

42 0
codex-team/hawk.laravel

Laravel errors Catcher module for Hawk.so

4,491 4
swayok/laravel-extended-errors

Laravel logging extender used to render logs and exceptions as HTML to store to...

1,385 1
joshcirre/duo

Local-first IndexedDB syncing for Laravel and Livewire applications.

23 36

Version History

Version Released PHP Laravel License
4.0.0 ^8.1 ^10.0|^11.0|^12.0|^13.0 MIT
3.1.3 ^8.1 ^10.0|^11.0|^12.0 MIT
3.1.2 ^8.1 ^10.0 MIT
3.1.1 ^8.1 ^10.0 MIT
3.1.0 ^8.1 ^10.0 MIT