ページ · Laravilt
Pages
Custom standalone pages in your panel.
Pages are standalone screens in your panel that don't belong to a resource: settings, reports, dashboards and so on. Each page is a PHP class extending Laravilt\Panel\Pages\Page, rendered through Inertia.
Creating a Page
| Argument / option | Description |
|---|---|
panel | Target panel (prompted if omitted) |
name | Page class name (prompted if omitted) |
--type= | basic, form, table or dashboard |
The command also asks which extras to add (header actions, footer actions, widgets, breadcrumbs, polling). It creates:
app/Laravilt/Admin/Pages/Settings.phpresources/js/pages/Admin/Settings.vuefor the Vue stack, orresources/js/pages/Admin/Settings.tsxfor the React stack
React support requires Laravilt v1.1 or later.
Basic Page
By default a page renders the built-in laravilt/Page component. It shows the page heading, header actions, widgets and the components returned by getSchema(). To render your own frontend page instead, set $view to its Inertia component name:
Navigation Properties
Authorization
The base page runs authorizeAccess() before rendering. Override it to restrict access:
To hide a page from the sidebar based on permissions, add the HasPageAuthorization trait. It checks a view_{page_name} permission, or the one you set in $permission:
Page API
| Member | Description |
|---|---|
$title, $slug, $view | Title, URL segment, Inertia component |
getHeading(), getSubheading() | Header text |
getSchema() | Form fields, sections or infolist entries to render |
getHeaderActions() | Actions in the page header |
getWidgets() | Widgets shown above the content |
getBreadcrumbs() | Breadcrumb trail |
getLayout() | Layout (PageLayout enum value) |
topHook() / bottomHook() | Extra content above/below the form |
In this section
- Page Forms: settings and data-entry pages
- Page Tables: data listings
- Page Infolists: read-only displays
- Page Widgets & Actions: widgets, header actions, subheadings, breadcrumbs