Download the PHP package e2d2-dev/filament-fqn-settings without Composer
On this page you can find all versions of the php package e2d2-dev/filament-fqn-settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download e2d2-dev/filament-fqn-settings
More information about e2d2-dev/filament-fqn-settings
Files in e2d2-dev/filament-fqn-settings
Package filament-fqn-settings
Short Description Easy management of fqn settings.
License MIT
Informations about the package filament-fqn-settings
Filament FQN Settings
Create, manage and keep track of your settings with ease.
FQN-Settings Concept
- stored as simple key => value pairs to keep it simple stupid
- exist as classes which are mirrored to the database
- cache enabled
- auto-discovery
- auto deployment on composer install
- default values on classes
Features
- Management of values
- Creation of settings
- Creation of Filament setting pages and schemas
Table of Contents
- File Structure
- Installation
- Install Using Composer
- Register to Panel
- Auto Discovery
- Pages Auto Discovery
- Settings Auto Discovery
- Package Auto Discovery
- Commands
- Create Setting Command
- Create Schema Command
- Create Page Command
- Working with Settings
- Adding Values to Schema
- Adding Fields to Schemas
- Using $get() and $set()
- Modifying Schema Return Type
- Schema - Common Methods
- Schema - Tabs
- Adding Schemas to Pages
- Mutating Data Before Save
- Fill Additional Data
- Add Components Before/After Schema
- Setting Value Resource
- Sync Action
- Create Page
- Cache Action
- Special Features
- Lost Settings
- Encrypted Settings
- Contributing
- Credits
File Structure
- One panel can have multiple setting pages
- One page can have multiple setting schemas
- One schema can have multiple setting values
Installation
The Package is available for Filament v3 and v4.
Install Using Composer
Register to Panel
Add FqnSettingsPlugin::make()
into your Filament PanelProvider
class panel()
method to register the ValueResource:
Auto Discovery
Pages Auto Discovery
Pages in App\Filament\Settings\Pages
will be discovered automatically. The SettingPage
is a regular Filament Page and can be added to the pages()
method.
Settings Auto Discovery
More directories can be added to the config file:
Package Auto Discovery
Directories can also be added in the register()
method inside Service Providers:
Commands
Create Setting Command
Creates a new setting in App\Settings
. The name can contain backslashes (\
), which will create nested folders and namespaces.
Create Schema Command
Creates a new setting schema in App\Filament\Settings\Schemas
.
Create Page Command
Creates a new setting page in App\Filament\Settings\Pages
.
Working with Settings
Adding Values to Schema
One schema can hold many setting values. Register them in the $fqnSettings
array:
Adding Fields to Schemas
Add components to the schema()
method like in regular resource pages. Pass the class name calling statically getStatePath()
.
This will set the state path of the component accordingly:
Using $get() and $set()
Both methods need a state path to work properly. This can be achieved by using getStatePath()
:
Modifying Schema Return Type
A Schema can be returned as plain array, Section, Group, Fieldset, Tab, or Tabs by changing the $returnAs
property. An Enum is provided:
Schema - Common Methods
Methods like Heading, Description, Icon, etc., which are common across layout components, can be used in the schema class like on resource pages. This allows switching layouts with minimal effort:
Schema - Tabs
Methods ending with "Tab" will be called automatically. The function name will be converted to title using str($name)->title()
:
Adding Schemas to Pages
One page can hold many setting schemas. Register them in the $settingComponents
array:
Mutating Data Before Save
You can mutate the data before it's saved, just like on regular resource pages:
Fill Additional Data
Add more data to the page:
Add Components Before/After Schema
You can add additional components before or after the schema:
Setting Value Resource
The package includes a Filament resource for managing setting values directly.
Sync Action
The Sync action calls the artisan settings:sync
command to synchronize settings between the database and the code.
Create Page
When your app is running in the "local" environment, settings can be created both in the database and as a file.
Cache Action
The Cache action allows you to purge a specific value from the cache, which can be useful during development or when troubleshooting.
Special Features
Lost Settings
When a setting class is moved or is no longer available, the setting will persist in the database. These entries will be marked as "lost" in the UI, allowing you to identify and manage orphaned settings.
Encrypted Settings
Settings that use encryption are marked with a green fingerprint icon in the UI, making it easy to identify which values are stored securely.
Contributing
Ideas, bug reports, and pull requests are welcome! Feel free to contribute to the development of this package.
Credits
- The entire Filament Team for creating an amazing admin panel framework
- All contributors to this package
All versions of filament-fqn-settings with dependencies
filament/filament Version ^3.3
e2d2-dev/laravel-fqn-settings Version ^1.0.12