The Website structure module lets administrators build menus from groups, urls and records of your models. The website reads the tree and renders the navigation.

Enabling the site tree

config/admin.php
Run php artisan admin:migrate. Developers define the structure: groups like the main menu or the footer, and which item types each part accepts. Allow editing of the structure with an environment variable, e.g. only locally:
.env
Administrators without it only add, rename and sort items where the structure allows it.

Items

Names and urls are translatable when localization is enabled.

Models in the site tree

Allow records of a model in the tree with $sitetree. The value is the label column:
app/Models/Branch.php
The tree loads the id, the label column and slug. Add more columns with siteTreeColumns(), or use the AdminWebsite\Eloquent\Concerns\HasSiteTree trait, which provides the default methods.

Rendering the navigation

resources/views/partials/menu.blade.php
Each item has: