Skip to content

PAM Native Laravel Sync

Every PAM Native product runs on the PAM runtime. Install and verify PAM first, create a Native application, and add this package through PAM Composer:

Terminal window
curl -fsSL https://github.com/push-in/pam/releases/latest/download/install.sh | sh
pam doctor
pam init my-app --template native
cd my-app
pam composer require pushinbr/pam-native-sync-laravel
pam doctor
pam native dev

Register every synchronized collection explicitly:

$registry->register('notes', new NotesSyncHandler());
$engine = new SyncEngine($store, new LaravelSyncTransport($http, $baseUrl));
$engine->synchronize(fn (SyncReport $report) => updateSyncStatus($report));

SyncCollectionRegistry maps collections to SyncCollectionHandler domain logic. SyncService orchestrates authenticated push/pull; SyncRepository persists idempotency and ordered changes; CursorCodec signs bounded cursors; LaravelSyncTransport connects the mobile engine.

Protect routes with application auth. Keep the HMAC key stable across deploys, define authorization/validation/conflict/retention per collection, and never put secrets in signed-but-unencrypted cursor state. Laravel 12 and 13 are supported.

SyncController validates a SyncRequest, passes its SyncEnvelope and IncomingOperation values to the service, and returns a SyncEnvelopeResource. Applied changes and push results serialize through AppliedChangeResource and PushOutcomeResource; their domain values are AppliedChange, PushOutcome, and integer-backed OperationStatus. LaravelSyncServiceProvider registers configuration, migrations, routes and bindings through Laravel package discovery.

LaravelSyncPluginProvider registers the Native transport. Domain handlers may raise SyncConflictException when a change cannot be resolved automatically.