MenuNode
Hierarchical menu builder: each node links to a Page, an ExternalLink, or any custom linkable model.
Columns
| Column | Type | Notes |
|---|---|---|
key | string | unique within its parent, optional |
title / label | jsonb | translated texts |
parent_id | bigint | tree hierarchy |
position | integer | ordering among siblings |
linkable_type / linkable_id | string / bigint | polymorphic target |
icon_key | string | optional icon |
modifiers | string | styling flags |
Behavior
has_closure_treefor the hierarchy, Orderable for positionsbelongs_to :linkable, polymorphic: true, optional: true- Includes Translatable and
strip_attributes
Notable methods
| Method | Returns |
|---|---|
to_s | title, label or key |
to_param | key or id |
icon? / icon | whether an icon is set / the IconComponent for it |
external_link? | whether the target is an ExternalLink |