MVC::Keayl::Admin

Every page of the MVC::Keayl::Admin manual, in reading order.

  • Overview The latest version of this documentation lives at https://gdonald.github.io/MVC-Keayl-Admin/.
  • Installation Add MVC::Keayl::Admin to your application's dependencies and install it. It brings the vendored Bootstrap and HTMX assets with it.
  • Mounting The admin ships as a MVC::Keayl engine. A host application mounts it at a path, the same way it mounts any other engine.
  • Registering resources A resource is declared by hand with register. Everything the admin shows for a model is stated explicitly. Nothing is inferred at request time.
  • Index pages The index page lists a resource's records in a table built from the declared columns. A generic controller resolves the resource from the URL, queries the...
  • Index presentations and panels By default the index renders a table. A resource can render its records as a card grid or a stacked list instead, by declaring index with an as and a...
  • Filters Filters are declared by hand. Each filter names a column, a type, and optionally a predicate and a collection. Nothing is inferred, and no filter ever...
  • Scopes A scope is a named view over the resource, declared with a block that is applied to the base relation. One scope can be marked :default.
  • Show pages The show page renders one record from its declared attributes. Each attribute is a detail row, using the same formatters as the index, so a value renders...
  • Nested resources A resource that belongs to another can be nested under its parent, scoping every view to the parent record, in the spirit of Active Admin's belongs_to.
  • Forms New and edit forms are built from declared fields. Each field maps by :as to an input type:
  • Actions Each index row has a delete control that issues an HTMX DELETE and removes the row in place on success. Before the request goes out, a Bootstrap...
  • Action availability and toolbar By default a resource exposes index, show, new/create, edit/update, and destroy. The actions declaration narrows that set. A disabled action loses its...
  • Authentication Every admin request runs through a pluggable authentication gate. Configure a strategy and the gate challenges or redirects unauthenticated visitors...
  • Authorization A policy controls which actions an admin may perform, which records they can see, and which menu entries and buttons render. The default policy allows...
  • Layout and chrome Admin pages render inside a Bootstrap 5 layout: a top bar with the site brand, a collapsible left sidebar that spans the full available height, a main...
  • Navigation Every registered resource gets a sidebar entry that links to its index. A menu declaration overrides the label and Bootstrap icon, assigns a group, sets a...
  • Customization Each index exports its current scoped-and-filtered view. The toolbar offers the enabled formats, and the export honours the active scope, filters, and...
  • Assets The admin ships a vendored frontend bundle and serves it through the engine, so it works with no external requests and no CDN dependency.
  • Worked example This wires a small blog into a grouped, filtered, authorized admin: authors and their posts, with scopes, a custom action, a role policy, and a dashboard...
  • Configuration reference The methods called on MVC::Keayl::Admin to set the admin up, in one place. Each links to the page covering it in detail. The per-resource declarations...