Skip to content

Commit

Permalink
Added selected method to tab field
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla committed May 1, 2024
1 parent 45484a4 commit 77d3d93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ Tab::make('Tab 1'),
Tab::make('Tab 2'),
Tab::make('Tab 3')
->placement('top') // top, left
->selected() // specify which tab should be selected by default
->endpoint(), // This will make a break in the tabs and create a new group of tabs
```

Expand Down
7 changes: 7 additions & 0 deletions src/Fields/Tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@ public function placement(string $placement): static

return $this;
}

public function selected(): static
{
$this->settings['selected'] = true;

return $this;
}
}

0 comments on commit 77d3d93

Please sign in to comment.