Configuration
Configure how your Laravel sync server registers routes, protects push and pull endpoints, resolves sync identity keys, stores applied mutations, and handles duplicate mutation IDs.
Publish the config file with:
php artisan vendor:publish --tag=tether-server-config
This creates config/tether-server.php in your server application.
connection
'connection' => env('TETHER_SERVER_DB_CONNECTION', null),
The database connection used for the tether_server_mutations table. null uses the application default. Useful in multi-database setups.
table
'table' => env('TETHER_SERVER_TABLE', 'tether_server_mutations'),
The table name for the server-side applied mutation log. The pull cursor sent to clients is not based on this table; it is an integer microsecond timestamp derived from syncable model updated_at / deleted_at values.
model_namespace
'model_namespace' => env('TETHER_MODEL_NAMESPACE', 'App\\Models'),
The namespace used when resolving model classes from incoming push mutation payloads. A mutation with model: "Task" resolves to App\Models\Task.
sync_key
'sync_key' => env('TETHER_SYNC_KEY', 'tether_id'),
The column name that holds the client-generated ULID on server-side models. Must match the sync_key in config/tether-client.php and the column in your migrations.
register_routes
'register_routes' => env('TETHER_REGISTER_ROUTES', true),
When true, the package automatically registers POST /tether/push and POST /tether/pull. Set to false to register routes manually - useful for embedding them in an API version prefix or using a custom controller.
route_prefix
'route_prefix' => env('TETHER_ROUTE_PREFIX', 'tether'),
The URL prefix for all Tether sync endpoints. With the default value, routes are registered at /tether/push and /tether/pull.
middleware
'middleware' => ['api'],
Middleware applied to the sync endpoints. Add authentication middleware that fits your app:
'middleware' => ['api', 'auth:sanctum'],
strict_duplicates
'strict_duplicates' => env('TETHER_STRICT_DUPLICATES', false),
When false (default), previously-applied mutations are returned as applied without re-applying (idempotent). When true, they are returned as rejected - useful for debugging to detect unexpected retries.
debug_level
'debug_level' => env('TETHER_DEBUG_LEVEL', 0),
Controls package debug logging (Log::debug()). 0 disables debug logging, 1 logs lifecycle summaries, 2 logs decisions and outcomes, and 3 logs verbose diagnostics. All package debug messages are prefixed with [TETHER].
Server Setup
Install tether/server, register Syncable Eloquent models, expose push and pull endpoints, and reconcile offline client mutations on your Laravel server.
Overview
See how tether/nativephp-client adds automatic offline sync triggers for NativePHP mobile apps on app resume, network restore, and background tasks.