@@ -25,39 +25,31 @@ php artisan filament:assets
2525Use the tree for a ` BelongsToMany ` relationship
2626
2727``` PHP
28- use CodeWithDennis\FilamentSelectTree\SelectTree;
29-
3028SelectTree::make('categories')
3129 ->relationship('categories', 'name', 'parent_id')
3230```
3331
3432Use the tree for a ` BelongsTo ` relationship
3533
3634``` PHP
37- use CodeWithDennis\FilamentSelectTree\SelectTree;
38-
3935SelectTree::make('category_id')
4036 ->relationship('category', 'name', 'parent_id')
4137```
4238
43- ## Customize Query
39+ ## Custom Query
4440
45- Customize the parent query:
41+ Customize the parent query
4642
4743``` PHP
48- use CodeWithDennis\FilamentSelectTree\SelectTree;
49-
5044SelectTree::make('categories')
51- ->relationship('categories', 'name', 'parent_id', modifyQueryUsing: fn($query) => $query));
45+ ->relationship(relationship: 'categories', titleAttribute: 'name', parentAttribute: 'parent_id', modifyQueryUsing: fn($query) => $query));
5246```
5347
54- Customize the child query:
48+ Customize the child query
5549
5650``` PHP
57- use CodeWithDennis\FilamentSelectTree\SelectTree;
58-
5951SelectTree::make('categories')
60- ->relationship('categories', 'name', 'parent_id', modifyChildQueryUsing: fn($query) => $query));
52+ ->relationship(relationship: 'categories', titleAttribute: 'name', parentAttribute: 'parent_id', modifyChildQueryUsing: fn($query) => $query));
6153```
6254
6355## Methods
@@ -197,6 +189,7 @@ use CodeWithDennis\FilamentSelectTree\SelectTree;
197189 })
198190])
199191```
192+
200193## Screenshots
201194![ download.png] ( ./resources/images/example.png )
202195
0 commit comments