afea/filament-settings

Settings module for the Afea Filament CMS package ecosystem: Spatie Settings-backed Company, Site, Footer, Mailing and Notification settings with a Filament cluster UI.

Maintainers

Package info

github.com/AfeaSoftware/filament-settings

pkg:composer/afea/filament-settings

Statistics

Installs: 1

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-04-21 10:48 UTC

This package is auto-updated.

Last update: 2026-04-21 11:57:56 UTC


README

Settings module for the Afea Filament CMS package ecosystem.

Ships five Spatie Settings groups wired into a Filament cluster:

  • CompanySettings — contact, address, working hours, location, social links, legal info
  • SiteSettings — robots.txt rules + head/body script injection
  • FooterSettings — reorderable footer link blocks
  • MailingSettings — SMTP credentials (username + password encrypted at rest)
  • NotificationSettings — per-event enable + channel routing + contact addresses (encrypted)

Plus:

  • EncryptedCast — transparent Crypt-wrapped cast for sensitive Settings properties
  • SettingsCluster — dedicated cluster with all pages mounted under it
  • AbstractSettingsPage — drop-in base for adding custom settings pages (handles mount/save boilerplate)
  • SettingsPlugin + afea:install:settings

Installation

composer require afea/filament-settings
php artisan afea:install:settings

Register in AdminPanelProvider:

->plugin(\Afea\Cms\Settings\Filament\SettingsPlugin::make())

Three common scenarios

1. Disable groups you don't need

// config/afea-settings.php
'groups' => [
    'company' => true,
    'site' => true,
    'footer' => false,       // no footer? skip.
    'mailing' => true,
    'notification' => false,
],

The disabled group's page is removed from the cluster and the Settings class is unregistered from Spatie so migrations stay inert.

2. Read settings anywhere

use Afea\Cms\Settings\Settings\CompanySettings;

$company = app(CompanySettings::class);
$company->email;
$company->working_hours;

3. Extend a Settings class with new properties

namespace App\Settings;

class CompanySettings extends \Afea\Cms\Settings\Settings\CompanySettings
{
    public ?string $slogan = null;
}
'classes' => [
    'company' => \App\Settings\CompanySettings::class,
],

Then add a migration:

$this->migrator->add('company.slogan', null);

The shipped CompanyInfoPage picks up your overridden class automatically; add a TextInput::make('slogan') to the schema by subclassing the page.

Adding your own settings page

use Afea\Cms\Settings\Filament\Pages\AbstractSettingsPage;

class BrandSettingsPage extends AbstractSettingsPage
{
    protected function settingsClass(): string
    {
        return \App\Settings\BrandSettings::class;
    }

    public function form(\Filament\Schemas\Schema $schema): \Filament\Schemas\Schema
    {
        return $schema->components([
            // ...
        ])->statePath('data');
    }
}

All mount/save plumbing is inherited. Just add the page to the panel via your plugin or directly.