Settings provides a registry-driven Filament settings page with groups, nested navigation and persistent values. It supports application settings through SettingsStorage and per-user preferences through the Preference model.
- Multiple settings groups defined with fluent
Definitionobjects. - Filament schemas for each group and optional parent-child navigation.
- Central
DefinitionRegistrywith a deterministic default group. - Persistent setting sections loaded into typed settings objects.
- Per-user JSON preferences.
- Configurable user model, navigation and database connection.
composer require phpinnacle/settings
php artisan vendor:publish --tag="phpinnacle-settings-migrations"
php artisan migrateuse Filament\Forms\Components\TextInput;
use PHPinnacle\Settings\Definition;
use PHPinnacle\Settings\SettingsPlugin;
$panel->plugin(
SettingsPlugin::make()->definitions(
Definition::make(GeneralSettings::class)
->label('General')
->slug('general')
->icon('phosphor-gear')
->sort(10)
->schema([
TextInput::make('site_name')->required(),
]),
),
);Definition::parent() groups a definition below another definition. A definition class may also provide its own form contract; the explicit schema() method is convenient for small groups.
SettingsStorage exposes register(), fill(), load() and save() for application setting sections. Preference::get(), retrieve() and store() provide the equivalent user-scoped API. Values are stored as JSON and keyed by group and key.
Publish phpinnacle-settings-config to change navigation, connection or the authenticatable user model.
composer testSee CHANGELOG. Released under the MIT License.