pushinbr / pam-native-sync-laravel
Independent Laravel server implementation of the PAM synchronization wire protocol.
Package info
github.com/push-in/pam-native-sync-laravel
pkg:composer/pushinbr/pam-native-sync-laravel
Requires
- php: ^8.5
- illuminate/contracts: ^12.0|^13.0
- illuminate/database: ^12.0|^13.0
- illuminate/http: ^12.0|^13.0
- illuminate/routing: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^10.0|^11.0
- phpunit/phpunit: ^11.5.50|^12.5.8|^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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.
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.