Skip to main content

Installation & pairing

From zero to a verified connection in five commands. You will not push any data here — that happens in the first full sync.

Requirements​

  • PHP 8.2+ (Laravel 13 requires PHP 8.3+)
  • Laravel 10, 11, 12 or 13
  • An APP_KEY set (Laravel uses it to encrypt the stored shared secret)

1. Require the package​

Terminal
composer require monoverse/laravel

Laravel package auto-discovery registers the service provider — there is no manual providers entry to add.

2. Publish the config​

Terminal
php artisan vendor:publish --tag="monoverse-config"

This writes config/monoverse.php, where you enable entity kinds and map your models. Leave it for now; Mapping covers it in full.

3. Run migrations​

Terminal
php artisan migrate

The package registers its migrations, so a plain php artisan migrate creates three tables — no migration-publish step is required:

TablePurpose
voicebot_connectionsPaired tenant id + encrypted shared secret + ingest URL
voicebot_sync_statePer-entity-kind watermark + last full-snapshot timestamp
voicebot_dead_letterDelta ops that failed to push, with a bounded attempt counter
Customising the schema

You only need to publish the migrations if you want to edit them. To do that:

Terminal
php artisan vendor:publish --tag="monoverse-migrations"

Otherwise skip it — the registered migrations run from the package directly.

4. Pair with your store key​

Copy your store's publishable key (pk_…) from the Monoverse cabinet and pass it to the command. Run it on the deployed app, the one serving the domain bound to the key:

Terminal
php artisan monoverse:pair pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

In a deploy pipeline, set the key in the environment and run monoverse:pair with no argument:

Terminal / CI
MONOVERSE_PUBLIC_KEY=pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx php artisan monoverse:pair

While the command waits, the API calls GET https://<your domain>/monoverse/pair-challenge over HTTPS to prove you control that domain (Pairing a backend). The package mounts that route itself and answers it from your cache, so use a database or redis cache store the web server shares with the artisan process — the file store on a second machine or the array store cannot answer.

The handshake mints your tenant id and a shared secret, stores them encrypted, and prints the tenant id and ingest URL:

monoverse:pair output
Paired with Monoverse.
Tenant: 3f9c…-…-…
Ingest: https://api.monoverse.tech

Next: `php artisan monoverse:doctor` then `php artisan monoverse:sync --full`.
The shared secret is never printed

monoverse:pair stores the secret encrypted (via Laravel Crypt, keyed by APP_KEY) and never prints or logs it. There is no command that reveals it. If you lose access, re-pair.

Already paired?​

monoverse:pair refuses to overwrite an existing connection. To switch tenants, run monoverse:unpair first, then pair again.

5. Verify​

Terminal
php artisan monoverse:doctor
Run doctor after every mapping change

monoverse:doctor is the fastest way to catch a broken map before it reaches the backend — it samples a real row per kind and checks the required payload keys without pushing anything.

Doctor is a read-only pre-flight. It checks pairing, backend reachability, and — per enabled kind — a resolvable model, a non-empty map, and that a sampled mapped row carries the backend-required payload fields. It emits one sample record per kind and pushes nothing.

monoverse:doctor output
Monoverse sync doctor
----------------------------------------
PASS pairing paired (tenant 3f9c…)
PASS backend reachable (provider_status=connected)
PASS entity:product 1240 rows, sample maps cleanly
{"kind":"product","external_id":"laravel:product:42","payload":{"name":"…","price_amount":19999,…}}
PASS entity:category 58 rows, sample maps cleanly

PASS — configuration looks healthy.

Fix every FAIL before syncing. WARN (for example "resolves but has 0 rows") is non-fatal but worth a look — a zero-row kind would make a full snapshot refuse to push. Doctor details are in Operations.

Configuration env vars​

All knobs are env-overridable; the defaults live in config/monoverse.php. The ones you are most likely to set:

EnvDefaultPurpose
MONOVERSE_BASE_URLhttps://api.monoverse.techIngest base URL (must be https://)
MONOVERSE_PUBLIC_KEY—Your store's pk_ key, for non-interactive pairing (CI)
MONOVERSE_SITE_URLAPP_URLSent as X-Monoverse-Site-Url on every request
MONOVERSE_SYNC_CHUNK_SIZE200Rows pulled per DB chunk while streaming
MONOVERSE_SYNC_QUEUEdefaultQueue connection used by monoverse:sync --queue
MONOVERSE_DEAD_LETTER_MAX_ATTEMPTS5Re-fail count before a dead-letter row is flagged exhausted
MONOVERSE_CURRENCYUAHConvenience default for example maps
https only

The ingest base URL must be https://. Plaintext http:// is rejected (an HMAC over http would leak the signature to a network attacker). localhost / 127.0.0.1 / ::1 are allowed for local development.

Next​

  • Map your models — the config-driven Eloquent map and the custom-source escape hatch.
  • Schedule syncs — deltas every few minutes, a nightly full.