Skip to content

PAM Native Laravel Sync

Terminal window
pam add laravel-sync
pam artisan vendor:publish --tag=pam-native-sync-config
pam artisan migrate
pam doctor

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.