Download the PHP package sitesource/laravel-polymorphic-settings-filament without Composer
On this page you can find all versions of the php package sitesource/laravel-polymorphic-settings-filament. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sitesource/laravel-polymorphic-settings-filament
More information about sitesource/laravel-polymorphic-settings-filament
Files in sitesource/laravel-polymorphic-settings-filament
Package laravel-polymorphic-settings-filament
Short Description Filament integration for sitesource/laravel-polymorphic-settings — base page class and trait that auto-bind settings to Filament forms.
License MIT
Homepage https://github.com/sitesource/laravel-polymorphic-settings-filament
Informations about the package laravel-polymorphic-settings-filament
Filament integration for laravel-polymorphic-settings
A base Filament page class and helper trait that auto-bind your form schema to sitesource/laravel-polymorphic-settings. Stop hand-rolling mount() / save() plumbing on every settings page.
That's it. Mount pulls every field's current value from the settings store. Save persists every field back, encrypting any TextInput->password() field at rest. No mount() or save() to write yourself.
Installation
You'll also need the core package installed and migrated:
Filament 4.x or 5.x is required. (Filament 3.x is supported by the v0.1.x line of this package.)
Usage
Global settings page
The default scope is global — settings live alongside PolymorphicSettings::global() reads/writes:
Scoped to a model (per-team, per-tenant, per-user)
Override scopeFor() to return the model whose settings you're editing:
Encryption
Any TextInput marked with ->password() is automatically persisted as encrypted: true. The Filament form continues to work normally — the user types a plaintext value, the page encrypts on save, and the next mount decrypts transparently.
Customising the post-save UX
Default behaviour is a Filament success notification. Override onSaved() to do anything else.
Trait variant: BindsToSettings
If you want to keep your own Page base (or use this on any Livewire component, not just Filament pages), use the trait:
The trait gives you fillFromSettings(array $keys): array and persistToSettings(array $values, array $encryptedKeys = []): void. You own the form schema and the lifecycle — the trait just bulk-reads and bulk-writes the store.
Testing
13 tests, 23 assertions. PHPStan level 5 + Pint clean.
Changelog
See CHANGELOG.md.
Credits
License
MIT — see LICENSE.md.
All versions of laravel-polymorphic-settings-filament with dependencies
filament/filament Version ^3.0||^4.0||^5.0
illuminate/contracts Version ^12.0||^13.0
sitesource/laravel-polymorphic-settings Version ^0.1.2
spatie/laravel-package-tools Version ^1.16