Skip to content

Route Snap

Dory Azar edited this page Nov 15, 2026 · 1 revision

Snap Cards and the assistant: Route::snap

Route::snap($options) declares, in one line of web.php, every capability of the app as a card and an assistant that answers with them. Since 2.23.0. This page is about the declaration; what people get, the card types, card views and hints are in Snap Cards and the assistant.

Auth::authentication('User', 'users');
Route::snap();

With Claude

"Add Snap Cards and the assistant to the app."

Check before you say OK:

  • Route::snap(); is below Auth::authentication(...);
  • php caligrafer.php snap install was run (the caligrafy_snap_* tables);
  • /assistant opens for a signed-in person and /snap lists the cards.

By hand

  1. One line in application/config/routing/web.php, after Auth::authentication(...):

    Route::snap();
  2. Its tables, and a starter hints file:

    php caligrafer.php snap install

    It creates the caligrafy_snap_* tables (they also come with php caligrafer.php platform install, and with every deploy) and application/config/snap.php, then prints what is ready.

  3. Open /assistant. The rest is optional: the queue_work job for background tasks, the snap_routines_due job for routines, and ANTHROPIC_API_KEY in .env for the assistant's model (without it, the assistant answers from the cards' names).


What it declares

Address What it is
GET /assistant Home (what needs you, insights, things to browse, shortcuts) and the task space; signed-in people only (comeBack)
POST /assistant/ask what the person typed, said, attached or clicked (snap_ask, a Route::action)
GET /assistant/noticed what the assistant noticed, and the person's routines (a settings page); signed-in people only
GET /snap every card the person may use (a gallery); visitors see the public capabilities
GET /snap/c/{capability} one card at its own address
POST /snap/run a card sent (snap_run, a Route::action)
POST /snap/call/{name} the snap_* capabilities the pages call, and only them, as the signed-in person

Changes only ever run from a Confirm the person clicks.


Options

Option Default What it does
assistant '/assistant' the path of the assistant and its pages
cards '/snap' the path of the cards and their routes
Route::snap(['assistant' => '/help', 'cards' => '/cards']);

Reference


Common mistakes

  • "Snap is almost ready" (503) on every Snap page: its caligrafy_snap_* tables are missing. Run php caligrafer.php snap install or platform install (after an update to 2.23.0, run one of them locally).
  • Route::snap() without Auth::authentication(...) above it: /assistant and /assistant/noticed are signed-in pages, and opening them stops with "'signedIn', 'level' and 'visitorsOnly' need Auth::authentication(...) in web.php".
  • Expecting async: true to change REST or MCP: #[Capability(..., async: true)] only changes Snap, where the card runs in the background as a Track: Task card.

Related pages

Caligrafy: Describe it. Approve it. Ship it. Your idea turned into a complete app: every feature built once, for web pages, Vue apps, a REST API and AI agents, and online.

Start here

Why Caligrafy: the benefits, the measurements, and what it is not yet

  1. Quickstart with Claude: describe it, approve it, ship it

    or the Quickstart: the same three steps by hand, in 5 minutes

  2. How Caligrafy works: the ideas in 5 minutes
  3. Your first capability: build a feature, page included

Capabilities

Experiences

Data and people

  1. Models
  2. Relationships
  3. Queries: filters, paging, related rows
  4. Sign-in, users and tokens

Built-in features

Put it online

Build with AI

Reference

Clone this wiki locally