Dollie Editor SDK guide

Laravel and Inertia

Embed the React editor while Laravel owns authorization and persistence.

Use the same React packages inside an Inertia page, while Laravel remains responsible for models, tenants, authorization, validation, and publishing.

Current availability

The React engine and Core catalog are public npm packages. The separate dollie/editor-laravel adapter is usable from its repository but is not yet documented here as a public Packagist dependency.

Your project must be able to resolve that Composer package before following the adapter-specific steps.

Install the frontend

npm install @dollie_ai/editor @dollie_ai/editor-catalog

Import the styles in your application stylesheet:

@import "tailwindcss";
@import "@dollie_ai/editor/styles.css";
@import "@dollie_ai/editor-catalog/styles.css";

Create an Inertia page component using the editor from Manual Installation. Pass the initial PageConfig, page id, capabilities, and revision as Inertia props.

Decide where saving happens

You can connect the editor in either of two ways:

  1. Post serialized editor state to a controller owned by your application.
  2. Enable and adapt the routes supplied by dollie/editor-laravel.

The adapter routes are disabled by default. Its current configuration includes the route prefix and middleware, page store, binding context resolver, binding providers, manifest, and seed paths.

Configure one or more editor surfaces

For one Catalog, configure the generated manifest path:

'manifest' => base_path('resources/editor/manifest.json'),

When one Laravel application serves several named Catalog configurations, give each surface its own manifest:

'manifest' => null,
'manifests' => [
    'page' => base_path('resources/editor/manifests/page.json'),
    'deck' => base_path('resources/editor/manifests/deck.json'),
],
'default_surface' => 'page',

Activate the correct manifest before a route resolves validation, fill, Catalog operations, MCP tools, or Copilot context:

use Dollie\Editor\Http\Middleware\ActivateEditorSurface;

Route::prefix('presentations')
    ->middleware(ActivateEditorSurface::class.':deck')
    ->group(function (): void {
        // Deck editor endpoints.
    });

ActivateEditorSurface also accepts a ?surface= query value when the middleware has no explicit parameter. Unknown ids do not change the active surface or fail the request. The surface id selects a manifest; it does not grant access, choose a tenant, or select a model.

For explicit host control, resolve ManifestRegistry and use:

$registry->surfaces();
$registry->has('deck');
$registry->activate('deck');
$registry->activeSurface();
$registry->active();
$registry->for('page');

The registry memoizes one ManifestRepository per surface. Services resolved afterwards receive the active repository, so the Laravel validator and AI tools use the same surface-specific vocabulary as the React editor.

Even when you use the adapter, your application still decides:

  • which model represents a page;
  • how a tenant is resolved;
  • who may edit or publish;
  • how drafts and revisions appear in your product;
  • which dynamic data bindings a user may access.

Keep the Inertia boundary small

A useful page prop shape is:

type EditorPageProps = {
  pageId: string;
  definition: PageConfig;
  revision?: string;
  capabilities: {
    bindings?: boolean;
    copilot?: boolean;
    publish?: boolean;
  };
};

Pass data required to initialize the editor. Fetch large binding lists or AI results only when the user asks for them.

Next steps