Docs CMS
The first-party filament-docs plugin is the CMS side of a docs site. Editors write pages in the panel and arrange them into a tree; the public /docs/{path} rendering lives in the clone, not in the package.
Storage
Pages are an adjacency list in the doc_pages table:
| Column | Purpose |
|---|---|
parent_id |
Self-FK; null = top level. Cascade delete removes a subtree. |
slug |
URL segment for this page. |
path |
Full slash-joined path from root to this page, unique. |
position |
Sibling order, rebuilt on save and on reorder. |
published_at |
null or future = draft; past = published. |
path is rebuilt on every save (Doc::buildPath) and propagated to children when a parent's slug, path, or parent_id changes, so the URL tree never drifts from the adjacency list.
Panel surface
FilamentDocsPlugin registers one resource and one page:
- Doc pages (
DocResource) — create / edit / list, withMediaMarkdownEditorbody, draft/published status, SEO fields, and a per-row Preview link to the public URL. - Docs sidebar (
ArrangeDocs) — the outline editor: drag the whole tree, reparent and reorder nodes, and persist throughDocOutline::applyTreeinside a transaction. Access is gated by theviewAnyDoc policy.
The sidebar supports unlimited depth; the public docs index page indents three levels visually.
Where rendering lives
This package is CMS only. Public /docs/{path} routes, Blade layout, and the index page are wired in the clone — the package never ships a public controller or view. This very site is a Docs CMS instance.
See also: