Usage
You can create a new setting page by running the following command:
php artisan make:filament-settings-page GeneralSettingsExecuting this command will create two files:
app/Filament/Pages/GeneralSettingsPage.php: The settings page class.app/Settings/GeneralSettings.php: The settings class.
To modify the form, go to GeneralSettingsPage.
To modify the default values, go to GeneralSettings.
Reading and writing settings
Use the FilamentSettings facade to get and set values anywhere in your application:
use VanOns\FilamentSettings\Facades\FilamentSettings;
// Get a setting value
$value = FilamentSettings::getValue('general');
$value = FilamentSettings::getValue('general', 'default');
// Set a setting value
FilamentSettings::setValue('general', ['site_name' => 'My App']);Note: The key corresponds to the
$settingsNameproperty on your settings page class.
Customization
Language files
If you want to customize the language files, you can publish them by running the following command:
php artisan vendor:publish --tag=filament-settings-lang