{"id":19133999,"url":"https://github.com/umbrellio/php-table-sync","last_synced_at":"2025-08-04T05:35:26.180Z","repository":{"id":42365572,"uuid":"324596195","full_name":"umbrellio/php-table-sync","owner":"umbrellio","description":"PHP's implementation of the library providing data synchronization between microservices","archived":false,"fork":false,"pushed_at":"2025-03-03T18:21:09.000Z","size":92,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-07T04:06:24.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umbrellio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-26T16:44:58.000Z","updated_at":"2025-03-03T18:21:01.000Z","dependencies_parsed_at":"2025-04-19T07:40:50.293Z","dependency_job_id":"a22c5744-a417-46da-b528-b5c74cf2322f","html_url":"https://github.com/umbrellio/php-table-sync","commit_stats":{"total_commits":25,"total_committers":10,"mean_commits":2.5,"dds":0.48,"last_synced_commit":"869b0f7c0673f82ce450bc41aca0a2ab284fe23f"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/umbrellio/php-table-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fphp-table-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fphp-table-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fphp-table-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fphp-table-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umbrellio","download_url":"https://codeload.github.com/umbrellio/php-table-sync/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fphp-table-sync/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268654911,"owners_count":24285125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T06:24:41.269Z","updated_at":"2025-08-04T05:35:26.157Z","avatar_url":"https://github.com/umbrellio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP TableSync\n\n###### PHP's implementation of the library providing data synchronization between microservices\n\n[![Github Status](https://github.com/umbrellio/php-table-sync/workflows/CI/badge.svg)](https://github.com/umbrellio/php-table-sync/actions)\n[![Coverage Status](https://coveralls.io/repos/github/umbrellio/php-table-sync/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/php-table-sync?branch=master)\n[![Latest Stable Version](https://poser.pugx.org/umbrellio/php-table-sync/v/stable.png)](https://packagist.org/packages/umbrellio/php-table-sync)\n[![Total Downloads](https://poser.pugx.org/umbrellio/php-table-sync/downloads.png)](https://packagist.org/packages/umbrellio/php-table-sync)\n[![Code Intelligence Status](https://scrutinizer-ci.com/g/umbrellio/php-table-sync/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence)\n[![Build Status](https://scrutinizer-ci.com/g/umbrellio/php-table-sync/badges/build.png?b=master)](https://scrutinizer-ci.com/g/umbrellio/php-table-sync/build-status/master)\n[![Code Coverage](https://scrutinizer-ci.com/g/umbrellio/php-table-sync/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/umbrellio/php-table-sync/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/umbrellio/php-table-sync/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/umbrellio/php-table-sync/?branch=master)\n\n\n## Installation\n\n```shell\ncomposer require umbrellio/php-table-sync\nphp artisan vendor:publish --tag=config-table-sync\n```\n\n## Usage\n\nLet's describe the model that needs to be synchronized using an example `User.php`\n\n```php\n...\nUser extends Model implements SyncableModel\n{\n    use TableSyncable;\n\n...\n\n    public function routingKey(): string\n    {\n        return 'users';\n    }\n\n    public function getTableSyncableAttributes(): array\n    {\n        return [\n            'id' =\u003e $this-\u003eexternal_id,\n            'login' =\u003e $this-\u003ename,\n            'email' =\u003e $this-\u003eemail,\n        ];\n    }\n...\n```\n\nWhen 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`\n\n## Logging\nLogging based on the Monolog package and contains some extensions for it.\n- specify the logging channel in `config/table_sync.php`\n```php\n...\n'log' =\u003e [\n    'channel' =\u003e 'table_sync',\n],\n...\n```\n- and describe this channel in `config/logging.php`\n```php\n...\n'table_sync' =\u003e [\n    'driver' =\u003e 'stack',\n    'channels' =\u003e ['table_sync_daily', 'influxdb'],\n],\n'table_sync_daily' =\u003e [\n    'driver' =\u003e 'daily',\n    'formatter' =\u003e LineTableSyncFormatter::class,\n    'formatter_with' =\u003e [\n        'format' =\u003e '[%datetime%] %message% - %model% %event%',\n    ],\n    'path' =\u003e storage_path('logs/table_sync/daily.log'),\n],\n'influxdb' =\u003e [\n    'driver' =\u003e 'influxdb',\n    'measurement' =\u003e 'table_sync',\n],\n...\n```\n\n##### You can use the built-in `LineTableSyncFormatter::class` with the available parameters: `%datetime%` `%message%` `%direction%` `%model%` `%event%` `%routing%` `%attributes%` `%exception%`\n\n###### Driver `influxdb` is an additional option and is not required to add in config\n```php\n...\n'table_sync' =\u003e [\n    'driver' =\u003e 'daily',\n],\n...\n```\n\n## Authors\n\nCreated by Korben Dallas.\n\n\u003ca href=\"https://github.com/umbrellio/\"\u003e\n\u003cimg style=\"float: left;\" src=\"https://umbrellio.github.io/Umbrellio/supported_by_umbrellio.svg\" alt=\"Supported by Umbrellio\" width=\"439\" height=\"72\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellio%2Fphp-table-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumbrellio%2Fphp-table-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellio%2Fphp-table-sync/lists"}