Download the PHP package danielcoulbourne/verbs-sync without Composer
On this page you can find all versions of the php package danielcoulbourne/verbs-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download danielcoulbourne/verbs-sync
More information about danielcoulbourne/verbs-sync
Files in danielcoulbourne/verbs-sync
Package verbs-sync
Short Description Simple CLI tool to sync Laravel Verbs events from a remote source
License MIT
Informations about the package verbs-sync
Verbs Sync
A Laravel package that allows applications using Verbs to sync events from a remote source.
Overview
Verbs Sync is a simple CLI tool that enables a Laravel application using the Verbs package to pull events from another Verbs-powered application. This tool focuses on a straightforward pull-based syncing model where your application acts as the destination, pulling events from a remote source.
Features
- Pull Verbs events from a remote source application
- API token authentication for secure communication
- Selective event filtering
- Event deduplication to prevent duplicate processing
- Comprehensive logging
- Simple command-line interface
Installation
You can install the package via composer:
After installing, publish the configuration file:
Run the migrations:
Quick Setup
- Install the package
- Publish the configuration
- Set your source URL and API token in your
.envfile - Run the sync command
Configuration
Configuration File
The package's configuration file (config/verbs-sync.php) contains the following settings:
source: Configuration for the remote source (URL and API token)events: Configuration for which events to sync (include/exclude)options: Syncing behavior options (batch size, retries)
Environment Variables
Configure the package using these environment variables:
Usage
To sync events from the source application:
Options
--since=TIMESTAMP: Only pull events since this timestamp (ISO-8601 format)--types=type1,type2: Comma-separated list of event types to pull--limit=100: Maximum number of events to pull per batch--dry-run: Show what would be synced without actually syncing
Examples
Sync all events:
Sync only specific event types:
Sync events since a specific time:
Preview what would be synced:
How It Works
- The
verbs:synccommand makes a request to the source application's Verbs API - It fetches events based on your filters (event types, time range, etc.)
- For each event, it:
- Checks if the event has already been synced (to avoid duplicates)
- Stores a record of the event in the local database
- Processes the event through your local Verbs system
- Events are marked with
synced: truemetadata to prevent infinite loops
Database Tables
The package creates two tables:
verbs_sync_events: Tracks synced events with their source, type, and statusverbs_sync_logs: Records sync operations for monitoring and troubleshooting
Integrating with Scheduled Tasks
For regular syncing, you can add the command to your Laravel scheduler:
Testing
This package includes a comprehensive test suite. To run the tests:
Test Coverage
The test suite covers:
- Behavior tests for core functionality
- Command option processing
- Event filtering and deduplication
- Error handling scenarios
- End-to-end flow simulation
Troubleshooting
If you encounter issues with event syncing:
- Use the
--dry-runoption to see what would be synced - Check your Laravel logs for errors
- Ensure your API token is configured correctly
- Verify network connectivity to the source application
- Check that event types are not excluded in configuration
License
This package is open-sourced software licensed under the MIT license.
This package is open-sourced software licensed under the MIT license.
All versions of verbs-sync with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
illuminate/console Version ^8.0|^9.0|^10.0|^11.0
guzzlehttp/guzzle Version ^7.0
hirethunk/verbs Version ^0.7.0