Skip to content
← All packages

Cbox Sync

beta

A framework-independent PHP sync engine for offline-first applications with one authoritative server and many replicas. Merges independent field edits atomically, keeps competing proposals with their provenance, and resolves the rest explicitly.

Cbox Sync keeps one authoritative server and many replicas in agreement when the replicas have been offline. It merges edits to different fields of the same record atomically, and where two replicas changed the same field it keeps both proposals with their provenance instead of silently picking one.

What it does not decide for you

The default preserves proposals rather than producing an order-independent canonical state. Where a conflict is real, it stays a conflict until something resolves it explicitly, versioned. That is a deliberate trade: last-write-wins is simpler and loses edits, and this package would rather hand you the disagreement than throw one side away.

Mutation ordering, idempotency, domain state, conflict candidates, results and acknowledgements all share one storage transaction, so a replica cannot observe half of an applied change.

Scope

PHP 8.4 and ext-pdo, with no third-party runtime dependencies and no Laravel requirement. Storage runs on SQLite, MySQL 8 and PostgreSQL through a PDO store, and a space takes one concurrent writer by design.

HTTP, authentication, Eloquent, NativePHP and restore are outside the package. Read the threat model before integrating; it is explicit about what this does not defend against.

Early release

This is a 0.x release. The API can still change between minor versions, and the docs here track both the tagged release and the main branch.