Skip to content

Commit efec6e4

Browse files
Update README.md
1 parent 0a2a19e commit efec6e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ use CodeWithDennis\FilamentSelectTree\SelectTree;
2424
use App\Models\Category;
2525

2626
SelectTree::make('category_id')
27-
// It uses the Category model to build a select tree with 'category_id' as the parent column and 'name' as the node label.
28-
->tree(Category::class, 'category_id', 'name')
27+
// Creates a select tree with 'Category' model, using 'category_id' as parent and 'name' as label, allowing custom query modification.
28+
->tree(Category::class, 'category_id', 'name', function ($query) {
29+
return $query;
30+
})
2931

3032
// Here, the label 'Category' is assigned to the field.
3133
->label(__('Category'))

0 commit comments

Comments
 (0)