position(): Position method, and the whole set is sorted by one shared resolver. The same placement rules apply panel-wide, so learning Position once covers all of it.
The API
Lunar\Panel\Support\Position is constructed through one of its static factories:
priority() is the coarse default most entries use implicitly — first-party entries sit at predictable priorities, and an entry that declares no position at all defaults to last(). before()/after() anchor an entry immediately adjacent to another entry in the same set, identified by its key, first-party or add-on.
Anchoring a row action next to another
lunarphp/panel-addon-example’s PingRowAction places itself right after the built-in edit row action on the Customers table:
edit and delete are ordinary TableActions in the same ordered set, so an add-on can position relative to them exactly as it would relative to another add-on’s action.
Inserting a navigation item before another
The samebefore()/after() anchors work on a NavigationItem’s position parameter, keyed by another item’s key:
NavigationItem’s priority constructor argument remains the ergonomic shortcut for coarse placement; an explicit position wins over it when both are considered. NavigationGroup supports the same priority/position pair for ordering groups relative to each other.
Fallback behavior
An anchor whose target key doesn’t exist — a typo, a reference to a key from an add-on that isn’t installed, or a cycle — falls back to priority-weight ordering, logged as a warning:Position::after('edit') read left to right by their own priority rather than in registration order.
Where Position applies
NavigationGroupandNavigationItem(navigation()/settingsNavigation()), including nested child items.TableColumn,TableFilter,TableAction, andTableBulkAction(tableExtensions()).PageAction(pageActions()).Widget(widgets()).SearchSourceandSearchCommand(searchSources()/searchCommands()).
NavigationItem shape.