Skip to content

Commit 70686da

Browse files
committed
Update README.md
1 parent a3b7467 commit 70686da

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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

228247
Use the tree in your table filters. Here's an example to show you how.

0 commit comments

Comments
 (0)