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

Showing the path

A department is saved as its key (42). TreePathEntry in infolists and TreePathColumn in tables show it as a path, reading each parent once per page.

The whole path

TreePathEntry::make('department_id')->tree(Department::class) shows the department of an order with all its parents.

Note: What you see

The department of the order is shown from the top level down.

Sales › Canada › Vancouver › Inside sales

Only the last levels

->pathDepth(2) keeps the last two levels, for narrow columns.

Note: What you see

Only the office and the team are shown, without Sales and the region.

Vancouver › Inside sales

Another separator

->pathSeparator(' / ') writes the path with slashes.

Note: What you see

The same path, written with / between the departments.

Sales / Canada / Vancouver / Inside sales

In a table

The orders list uses TreePathColumn for the department, and TreeFilter to filter the orders by a department.

Note: Try it

Open the orders: the Department column shows the path of each order.