File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,25 @@ use CodeWithDennis\FilamentSelectTree\SelectTree;
223223])
224224```
225225
226+ If you need to append an item to the tree menu, use the ` append ` method. This method also accepts an array or a closure.
227+
228+ ``` php
229+ ->schema([
230+ SelectTree::make('category')
231+ ->relationship('categories', 'name', 'parent_id')
232+ ->enableBranchNode()
233+ ->multiple(false)
234+ ->append([
235+ 'name' => 'Uncategorized Records',
236+ 'value' => -1,
237+ 'parent' => null, // optional
238+ 'disabled' => false, // optional
239+ 'hidden' => false, // optional
240+ 'children' => [], // optional
241+ ])
242+ ])
243+ ```
244+
226245## Filters
227246
228247Use the tree in your table filters. Here's an example to show you how.
You can’t perform that action at this time.
0 commit comments