Organising the inspector
section(), tab() and badge() structure the settings inspector. They don't change the data a section stores.
Sections
section() groups fields under a named, collapsible heading. It's presentation only - unrelated to group(), which is a data shape.
Settings::make()
->section('Content', function (Settings $settings) {
$settings->text('heading')->label('Heading')->required()->default('Welcome');
$settings->textarea('subheading')->label('Subheading')->default('');
})
->section('Appearance', function (Settings $settings) {
$settings->select('alignment')->label('Alignment')->options(['left' => 'Left', 'center' => 'Centred'])->default('left');
});
Tabs
tab() works the same way but renders tab navigation - only when a section declares more than one tab. A section() inside a tab() callback produces a collapsible group within that tab.
Settings::make()
->tab('Content', function (Settings $settings) {
$settings->text('heading')->label('Heading')->default('Welcome');
})
->tab('SEO', function (Settings $settings) {
$settings->text('metaTitle')->label('Meta title')->default('');
});
Badges
badge() shows a short callout next to a field's label:
$settings->link('cta')->label('Button')->badge('New');
Conditional visibility
visibleWhen() and hiddenWhen() show or hide a field based on another field's value. They're a UI convenience, not a security boundary.
Settings::make()
->toggle('showCta')->label('Show call to action')->default(false)
->text('ctaLabel')->label('Button label')->visibleWhen('showCta', true)->default('');
Your view makes the same decision with the value:
@if ($showCta)
<a href="#">{{ $ctaLabel }}</a>
@endif
Instance labels
The editor's section list labels each section with its name plus a short detail, so three heroes read as Hero - "Welcome", Hero - "Our story" and so on.
By default it uses the first of a setting named heading, title, name or label, then the first text() setting. It only ever uses a short text field, never a textarea, rich text, image or structured field.
Name the field explicitly when the guess is wrong:
Settings::make()
->text('eyebrow')->label('Eyebrow')->default('')
->text('headline')->label('Headline')->default('Welcome')
->instanceLabel('headline');
instanceLabel() only takes effect for a text() field.