Warp Tree demo — trees of departments and categories for Filament: choose, filter, edit by dragging. Change or delete anything; the data is reset every hour. warpui.com About Warp Tree Docs Ask a question Support
Skip to content

Who sees what

Heads of department see their own department and everything under it, nothing else. One line on the plugin says which department each person runs; resources and fields follow it.

See the demo as…

Everyone in this demo shares one account, so choose here whose eyes to use. A real app writes ->visibleSubtree(fn (User $user) => $user->department_id).

Note: Try it

Choose “Head of East”. The numbers below drop to East and the offices under it. The orders and departments pages change too, until you choose “Everyone” again.

View as
You see 193 departments and 60 orders.

A field limited to what you see

->onlyVisibleSubtree(): the tree starts at your own department, and the server refuses anything outside it.

Note: Try it

As Head of East, open the field: East is the only top-level item. Type “seattle”: nothing is found.

Resources limited to what you see

OrderResource and DepartmentResource use the ScopedToVisibleSubtree trait: lists, filters, edit pages and the tree page show only your branch. An order of another branch is not found even by its URL. The History on the tree page lists only the changes in your branch.

Note: Try it

As Head of East, open the orders: every order belongs to an East office. Open the departments: you can rearrange East, but not move it out. To compare the History: as Everyone, drag one department inside Finance and one inside East on the departments page, then choose Head of East above and press History there. Only the East change is listed.