Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

anibabbar's avatar

Filament + Spatie Settings Issue.

Error: Tried loading settings 'App\Settings\GeneralSettings', and following properties were missing: tagline, favicon, logo_light, logo_dark, custom_css, custom_js, admin_email

Filament Page

Config File Settings.php

0 likes
1 reply
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

The error message indicates that the settings properties are missing when trying to load the GeneralSettings class. This usually happens when the settings are not properly saved in the database or the settings migration has not been run.

Here are the steps to resolve this issue:

  1. Ensure Settings Migration Exists and is Run: Make sure you have created a settings migration for the GeneralSettings class. If not, you can create one using the following command:

    php artisan make:settings-migration create_general_settings
    

    This will create a migration file in the database/settings directory. Open the migration file and ensure it includes all the properties defined in your GeneralSettings class.

    use Spatie\LaravelSettings\Migrations\SettingsMigration;
    
    return new class extends SettingsMigration {
        public function up(): void
        {
            $this->migrator->add('general.tagline', 'Poetry');
            $this->migrator->add('general.name', 'Laravel');
            $this->migrator->add('general.favicon', 'favicon.ico');
            $this->migrator->add('general.logo_light', 'logo.png');
            $this->migrator->add('general.logo_dark', 'logo-dark.png');
            $this->migrator->add('general.custom_css', 'some text');
            $this->migrator->add('general.custom_js', 'some more text');
            $this->migrator->add('general.admin_email', '[email protected]');
        }
    };
    

    After creating the migration, run it using:

    php artisan migrate
    
  2. Check Database Settings: Ensure that the settings are correctly stored in the database. You can check the settings table (or the table specified in your configuration) to verify that the settings are present.

  3. Clear Cache: If you have caching enabled for settings, clear the cache to ensure the latest settings are loaded.

    php artisan cache:clear
    
  4. Verify Configuration: Ensure that your config/settings.php file is correctly configured to use the GeneralSettings class.

    return [
        'settings' => [
            'general' => \App\Settings\GeneralSettings::class,
        ],
        // other configurations...
    ];
    
  5. Update Filament Page: Ensure that your Filament page is correctly referencing the settings and form fields.

By following these steps, you should be able to resolve the issue with missing properties in the GeneralSettings class.

1 like

Please or to participate in this conversation.