Search by

pushinbr / pam-native-sync-laravel

Independent Laravel server implementation of the PAM synchronization wire protocol.

Maintainers

Package info

github.com/push-in/pam-native-sync-laravel

pkg:composer/pushinbr/pam-native-sync-laravel

Transparency log

Statistics

Installs: 7

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.3.1 2026-08-25 22:03 UTC

This package is auto-updated.

Last update: 2026-08-25 22:04:16 UTC


README

PAM Native Sync for Laravel

A production Laravel sync endpoint that remains independent from every mobile SDK.

Serve the stable integer-coded sync protocol to PAM Native, web, desktop, or any other client with validated requests, transactional services, repositories, and typed resources.

Latest version CI PHP

Documentation · Quick start · What you can build · PAM ecosystem · Issues

Why PAM Native Sync for Laravel

Connect offline outboxes and cursors to Laravel with validated requests, transactional services, repositories, and typed resources. The package does not require PAM, PAM HTTP, PAM Native, or the mobile sync client. Frontend and backend can be installed, upgraded, tested, and deployed independently.

Best for A Laravel backend serving offline-capable clients
Server path Form Request → service → repository → API Resources
Application model Ordinary Laravel Composer package
Design rule Wire-compatible but dependency-independent from every frontend

What you can build

  • Mobile-to-Laravel offline synchronization
  • Server-issued cursors and incremental change feeds
  • Central conflict policy and idempotent mutation handling

Quick start

Install it only in the Laravel backend:

composer require pushinbr/pam-native-sync-laravel

The mobile application separately installs whichever sync client it chooses. pushinbr/pam-native-sync is one compatible client, not a server dependency.

The server provides authenticated incremental pulls, idempotent mutation ingestion, HMAC-signed cursors, conflict responses, collection registration, and retention boundaries. Its JSON protocol uses sequential integer enums and does not expose PHP class names or framework-specific objects.

See it in action

// AppServiceProvider.php
$registry->register('notes', new NotesSyncHandler());
// PAM Native application (in its own repository/process)
$engine = new SyncEngine($store, new HttpSyncTransport(
    endpoint: $baseUrl.'/sync',
    clientIdentifier: $deviceId,
    tokenProvider: fn (): ?string => $token,
));
$engine->synchronize(fn (SyncReport $report) => updateSyncStatus($report));

Publish config/pam-native-sync.php, protect the supplied routes with your authentication middleware, register an explicit handler for every synchronized collection, and keep the HMAC key stable across deploys. Cursor payloads are signed and bounded but are not encrypted; never place secrets inside cursor state.

Laravel 12 and 13 are supported. The integration suite boots a real Testbench application and verifies push idempotency, pull cursors, validation, resources, and conflict flow.