Skip to content

Commit 7b4f051

Browse files
Update README.md
1 parent 6b64b2e commit 7b4f051

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,26 @@ SelectTree::make('category_id')
4040
->relationship('category', 'name', 'parent_id')
4141
```
4242

43+
## Customize Query
44+
45+
Customize the parent query:
46+
47+
```PHP
48+
use CodeWithDennis\FilamentSelectTree\SelectTree;
49+
50+
SelectTree::make('categories')
51+
->relationship('categories', 'name', 'parent_id', modifyQueryUsing: fn($query) => $query));
52+
```
53+
54+
Customize the child query:
55+
56+
```PHP
57+
use CodeWithDennis\FilamentSelectTree\SelectTree;
58+
59+
SelectTree::make('categories')
60+
->relationship('categories', 'name', 'parent_id', modifyChildQueryUsing: fn($query) => $query));
61+
```
62+
4363
## Methods
4464

4565
Set a custom placeholder when no items are selected

0 commit comments

Comments
 (0)