Skip to content

Aurora 1.0 is out!

What's new →
Docs menu

Building a site

Your own settings

Add tabs to Settings and read them in your templates.

Add tabs to Settings from a service provider. Fields are saved with the other settings and read with Setting::get().

app/Providers/AppServiceProvider.php PHP
use Aurora\Support\SettingsTabs;
use Filament\Schemas\Components\Tabs\Tab;
use Filament\Forms\Components\TextInput;

SettingsTabs::register(
    'opening-hours',
    fn (): Tab => Tab::make(__('Opening hours'))->schema([
        TextInput::make('opening_hours')->label(__('Opening hours')),
    ]),
    siteKeys: ['opening_hours'],      // each site keeps its own value
    page: 'website',                  // join Settings › Website (or null for a page of its own)
    publicKeys: ['opening_hours'],    // may be shown by the REST/GraphQL APIs
);
Blade
<p>{{ \Aurora\Models\Setting::get('opening_hours') }}</p>

Private unless you say so

Settings are private unless a tab lists them in publicKeys. Never list keys, tokens or anything visitors shouldn't see.

This website adds the Header and Footer tabs under Settings › Website this way: the header button, the announcement bar, the footer note and social profiles.