Platform admin
Documentation editor (DB-backed)
The Documentation editor at /admin/docs is a DB-backed
CRUD surface for the public /documentation/* site.
Pages created here supersede the legacy Blade partials at
resources/views/documentation/pages/{slug}.blade.php
with the same slug — the public renderer queries the
doc_pages table first, then falls back to the Blade
partial registered in App\\Support\\DocumentationNav.
What this card ships (Phase 3 #195)
- The
doc_pagesschema (slug, title, section, sort_order, body_markdown, is_published, timestamps). - Admin CRUD at
/admin/docs: grouped index by section, create + edit forms with a markdown editor + live preview, reorder via per-item up/down buttons, draft / publish toggle, and hard delete. - Public render path: published DocPages win, unknown slugs fall back to the Blade partial, completely-unknown slugs 404.
What this card does NOT ship (Phase 3 #196 will)
- Bulk-migrating the ~70 shipped Blade pages into
doc_pagesrows. They keep working via the fallback path until #196 lands. - Cross-section drag-and-drop reorder (today's UI moves a row within its section only).
Creating a page
- Open
/admin/docs→ click New page. - Fill Title, optionally a Slug (auto-derived when blank), pick a Section from the datalist or type a new one.
- Write the body in Markdown. Use the Split view to watch the preview as you type — same GitHub-flavoured renderer the public site uses, with HTML escaping.
- Toggle Publish on when ready. Drafts 404 publicly.
- Save.
Field reference
| Column | Type | Meaning |
|---|---|---|
slug |
string(120), unique | URL identifier. Renaming is allowed (no Stripe-style external reference), but inbound links won't auto-update — fix them yourself or set up a redirect. |
title |
string(200) | Page title (h1) + sidebar entry. |
section |
string(120) | Sidebar group. New sections render as new sidebar groups in the public site automatically. |
sort_order |
integer | Lower numbers render first within the section. |
body_markdown |
text, max 200000 chars | GitHub-flavoured markdown. Raw HTML is escaped for safety. |
is_published |
boolean, default false | Drafts 404 publicly. Toggle on once ready. |
Finding the editor for a page you're reading
The fastest way in: while signed in as a super-admin, open any public
documentation page (e.g. /documentation/welcome) — an
Edit page link appears in the docs top bar that jumps
straight to that exact page's editor. No need to hunt for it in the
list. The link is only rendered for super-admins; visitors never see
it.
Editing a shipped (imported) page
Once the shipped pages have been bulk-imported (see
Migrating Blade docs into the database), every page already
has a doc_pages row you can open and edit at
/admin/docs. These imported rows carry
source=blade_migration and keep the original
rendered HTML in a body_html column so the page
looks identical before anyone touches it. Their
body_markdown field holds a short placeholder
("Edit this markdown to take over the page…") rather than the
full prose, because the original was authored as HTML, not markdown.
How an edit takes over: when you save any edit to an
imported page, the editor clears the stored
body_html and flips source to
admin. From that moment the public page renders your
body_markdown — so your change shows immediately.
(Before this was wired up, an edit saved to
body_markdown but the stale body_html kept
shadowing it, so the public page appeared unchanged. That is fixed:
saving always hands the page over to your markdown.)
Practical tip: opening an imported page shows the placeholder in the editor, not the original prose. To rewrite it, replace the placeholder with your own markdown and save. If you only want a small change to a long imported page, copy the relevant text out of the live page first, paste it into the editor as markdown, edit, and save.
A brand-new page you create here (not imported) never has
body_html, so its markdown renders directly with no
extra step.
Markdown features
- Standard GitHub-flavoured markdown: headings, lists, links, code blocks, tables.
- Raw
<script>,<style>, and inline HTML are escaped — the renderer is configured withhtml_input=escapeandallow_unsafe_links=false. - Wiki-style cross-links:
[[other-slug]]are not auto-linked by the GFM renderer; if you want them, write regular markdown links:[Other page](/documentation/other-slug).
Preview rate-limit
The preview endpoint at POST /admin/docs/preview is
throttled to 60 requests per minute per user.
The editor debounces typing at 400ms, so a normal editing session
fits well under the cap; pasting a large document or holding a key
can briefly hit the limit. When that happens the preview pane shows
a banner explaining how long to wait — the editor resumes
previewing automatically once the window resets.
See also: Migrating Blade docs into the database for bulk-importing the shipped documentation pages.