Appearance
Sidebar and Navigation
Overview
The dashboard sidebar is driven by a built-in sidebar system and configured centrally in app/sidebar.php.
This makes the navigation tree predictable and easy to extend.
Sidebar Item API
Each sidebar item supports:
| Method / Property | Purpose |
|---|---|
title(...) | Display label |
icon(...) | Icon class |
route(...) | Route name and optional parameters |
url(...) | Raw URL |
external(...) | Marks item as external |
children(...) | Nested child items |
hidden(...) | Static boolean or closure |
Internally, items also track:
parentparametersactive
Visibility Rules
A sidebar item can be removed from the final rendered menu when:
- the target route fails
route_allowed(...) - the item is marked hidden
- a hidden closure returns true
- all children of a dropdown were filtered out
Active State Rules
An item becomes active when:
- the current route exactly matches the item route
- the current route matches the item route as a wildcard, replacing
.indexwith.*
If a child item is active, its parent dropdown is marked active too.
Built-In Sidebar Structure
Dashboard
dashboard.index
Website Management
dashboard.users.indexdashboard.static-pages.index
Utilities
dashboard.memos.indexdashboard.qr-code.indexdashboard.shortened-urls.indexdashboard.impersonate-admins.createdashboard.impersonate-users.create
Settings
dashboard.profile.editdashboard.roles.indexdashboard.admins.indexdashboard.settings.editdashboard.languages.index
Practical Guidance
When adding a new module to navigation:
- add the route first
- decide whether the item should be permission-gated
- add a sidebar item or child item in
app/sidebar.php - use a hidden closure only when the module really depends on runtime state