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>
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.