diff --git a/README.md b/README.md index 87877b6..335a0f4 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/src/Fields/Tab.php b/src/Fields/Tab.php index 7b9a357..b11c15e 100644 --- a/src/Fields/Tab.php +++ b/src/Fields/Tab.php @@ -38,4 +38,11 @@ public function placement(string $placement): static return $this; } + + public function selected(): static + { + $this->settings['selected'] = true; + + return $this; + } }