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.
v0.1.0
2026-04-21 10:48 UTC
Requires
- php: ^8.4
- afea/filament-cms-core: @dev
- filament/filament: ^4.0
- illuminate/contracts: ^12.0
- illuminate/database: ^12.0
- illuminate/support: ^12.0
- laravel/prompts: ^0.3
- spatie/laravel-settings: ^3.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
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 propertiesSettingsCluster— dedicated cluster with all pages mounted under itAbstractSettingsPage— 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.