Skip to content

Commit

Permalink
Merge pull request #21 from CodeWithDennis/feature/add-direction-option
Browse files Browse the repository at this point in the history
Fixed a bug where `defaultOpenLevel` had to be set
  • Loading branch information
CodeWithDennis authored Sep 23, 2023
2 parents 210c3e2 + 3078923 commit e764cf1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/SelectTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SelectTree extends Field

protected ?Closure $modifyQueryUsing;

protected Closure|int $defaultOpenLevel;
protected Closure|int $defaultOpenLevel = 0;

protected string $direction = 'auto';

Expand Down

0 comments on commit e764cf1

Please sign in to comment.