From 77d3d93e7ebe952b01cd7744ade5cb754d491779 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Wed, 1 May 2024 19:33:25 +0200 Subject: [PATCH] Added selected method to tab field --- README.md | 1 + src/Fields/Tab.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 87877b67..335a0f42 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 7b9a3573..b11c15e1 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; + } }