diff --git a/README.md b/README.md index da263c6..d3b52f7 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ php artisan filament:assets ## Usage ```PHP +use CodeWithDennis\FilamentSelectTree\SelectTree; + // Create a tree based on a 'BelongsToMany' relationship SelectTree::make('categories') ->relationship('categories', 'name', 'parent_id', function ($query) { diff --git a/src/SelectTree.php b/src/SelectTree.php index bf1623e..31907b3 100644 --- a/src/SelectTree.php +++ b/src/SelectTree.php @@ -45,7 +45,7 @@ class SelectTree extends Field protected ?Closure $modifyQueryUsing; - protected Closure|int $defaultOpenLevel; + protected Closure|int $defaultOpenLevel = 0; protected string $direction = 'auto';