PHPackages                             bambamboole/filament-settings - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bambamboole/filament-settings

ActiveLibrary

bambamboole/filament-settings
=============================

Manage application settings with a Filament UI

0.3.0(4d ago)0343↓100%MITPHPPHP ^8.3CI passing

Since Feb 25Pushed 4d agoCompare

[ Source](https://github.com/bambamboole/filament-settings)[ Packagist](https://packagist.org/packages/bambamboole/filament-settings)[ Docs](https://github.com/bambamboole/filament-settings)[ GitHub Sponsors](https://github.com/bambamboole)[ RSS](/packages/bambamboole-filament-settings/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (11)Versions (6)Used By (0)

Filament Settings
=================

[](#filament-settings)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c6fc52a2df4786b9c9ab53cdc76be13334b32108ef09a199c74b81bf7fe572fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62616d62616d626f6f6c652f66696c616d656e742d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bamamboole/filament-settings)[![GitHub Tests Action Status](https://camo.githubusercontent.com/9fe3a8b33aa9658dfce196483f40fa007ec2ba6aa6af102a1491d9c1a3ce6511/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62616d616d626f6f6c652f66696c616d656e742d73657474696e67732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/bamamboole/filament-settings/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/b7a10804f758b9865b72fc26c9b9f09b2911ab3273353f4db3f98b67d0bc7683/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62616d616d626f6f6c652f66696c616d656e742d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bamamboole/filament-settings)

A database-driven settings plugin for [Filament](https://filamentphp.com). Settings are organised into groups, edited through a tabbed Filament page, and read anywhere via the `settings()` helper or the typed `SettingsRepository` methods.

Installation
------------

[](#installation)

```
composer require bamamboole/filament-settings
```

Publish and run the migration:

```
php artisan vendor:publish --tag="filament-settings-migrations"
php artisan migrate
```

Setup
-----

[](#setup)

Register the plugin in your panel provider and pass your `SettingGroup` classes:

```
use Bamamboole\FilamentSettings\FilamentSettingsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentSettingsPlugin::make()
                ->groups([
                    GeneralSettings::class,
                    MailSettings::class,
                ]),
        ]);
}
```

Generating a Setting Group
--------------------------

[](#generating-a-setting-group)

Use the Artisan command to scaffold a new `SettingGroup` class interactively:

```
php artisan settings:make-group
```

The command asks for a class name, group key, and label, then writes the skeleton to `app/Settings/{ClassName}.php`:

```
 ┌ Class name ──────────────────────────────────────────────────┐
 │ GeneralSettings                                              │
 └──────────────────────────────────────────────────────────────┘

 ┌ Group key ───────────────────────────────────────────────────┐
 │ general                                                      │
 └──────────────────────────────────────────────────────────────┘

 ┌ Label ───────────────────────────────────────────────────────┐
 │ General                                                      │
 └──────────────────────────────────────────────────────────────┘

 ◇  Created: app/Settings/GeneralSettings.php

```

The group key is derived automatically from the class name (`GeneralSettings` → `general`, `MailNotificationSettings` → `mail-notification`). Accept the defaults or type a custom value.

After generation, open the file and fill in `schema()` with Filament form components and optionally add `casts()`, `icon()`, and `sort()`.

Defining a Setting Group
------------------------

[](#defining-a-setting-group)

Create a class that extends `SettingGroup`. The `key()` is used as the DB prefix and the tab identifier; `schema()` returns standard Filament form components:

```
use Bamamboole\FilamentSettings\SettingGroup;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Support\Icons\Heroicon;

class GeneralSettings extends SettingGroup
{
    public static function key(): string
    {
        return 'general';
    }

    public function label(): string
    {
        return 'General';
    }

    public function icon(): Heroicon
    {
        return Heroicon::OutlinedCog6Tooth;
    }

    public function sort(): int
    {
        return 0;
    }

    public function casts(): array
    {
        return [
            'launched' => 'boolean',
        ];
    }

    public function schema(): array
    {
        return [
            TextInput::make('site_name')->label('Site Name')->maxLength(255),
            Toggle::make('launched')->label('Launched'),
        ];
    }
}
```

### Field name convention

[](#field-name-convention)

Form field names use `snake_case` (e.g. `site_name`). They are stored in the database as `kebab-case` keys prefixed with the group key (e.g. `general.site-name`).

### Casts

[](#casts)

Declare non-string fields in `casts()`. Supported types: `boolean`, `integer`. Everything else is returned as a raw string.

### Access control per group

[](#access-control-per-group)

Override `canAccess()` on a group to hide it from certain users:

```
public static function canAccess(): bool
{
    return auth()->user()->isAdmin();
}
```

Reading Settings
----------------

[](#reading-settings)

### Helper function

[](#helper-function)

```
// Get a value (returns null when not set)
$name = settings('general.site-name');

// Get with a default
$name = settings('general.site-name', 'My App');

// Access the repository directly
settings()->set('general.site-name', 'New Name');
```

### Typed repository methods

[](#typed-repository-methods)

```
settings()->bool('general.launched', false);
settings()->int('general.max-items', 10);
settings()->string('general.site-name', 'My App');
settings()->array('general.allowed-ips', []);
```

### Injecting the repository

[](#injecting-the-repository)

```
use Bamamboole\FilamentSettings\SettingsRepository;

class SomeService
{
    public function __construct(private SettingsRepository $settings) {}

    public function isLaunched(): bool
    {
        return $this->settings->bool('general.launched');
    }
}
```

Caching
-------

[](#caching)

Caching is enabled by default. All settings for each tenant are loaded and cached in a single cache entry per tenant. Casts from all registered groups are cached together in one additional entry.

Cache keyContains`settings.global`All settings where `team_id IS NULL``settings.{id}`All settings for tenant with that ID`settings.casts`Combined cast map from all `SettingGroup`sThe tenant bucket is automatically invalidated whenever a setting is saved or deleted. Configure the TTL or disable caching in `config/filament-settings.php`:

```
'cache' => [
    'enabled' => env('SETTINGS_CACHE_ENABLED', true),
    'ttl'     => env('SETTINGS_CACHE_TTL', 3600),
],
```

Multi-Tenancy
-------------

[](#multi-tenancy)

All settings have a `team_id` column. A global scope filters every query to the current tenant automatically. When `team_id` is `null`, the global (non-tenant) settings are used.

Configure the active tenant via the plugin:

```
FilamentSettingsPlugin::make()
    ->groups([...])
    ->tenant(fn () => auth()->user()->team_id),
```

When using Filament's built-in tenancy, `Filament::getTenant()` is used automatically — no manual configuration needed.

Plugin Options
--------------

[](#plugin-options)

MethodDescription`groups(array)``SettingGroup` classes to register`canAccess(Closure)`Guard access to the entire settings page`tenant(Closure)`Custom resolver for the current tenant ID`navigationSort(int)`Position in the sidebar (default: `99`)`navigationGroup(?string)`Sidebar group label (default: none)Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](.github/SECURITY.md) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Manuel Christlieb](https://github.com/bamamboole)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance99

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

4

Last Release

4d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/547137a6d80cad01ed1dd065b1c6af329d9a23a4134a895cff01e078cc155500?d=identicon)[bambamboole](/maintainers/bambamboole)

---

Top Contributors

[![bambamboole](https://avatars.githubusercontent.com/u/8823695?v=4)](https://github.com/bambamboole "bambamboole (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelfilamentfilament-pluginfilamentphpfilament-settingsbambamboole

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/bambamboole-filament-settings/health.svg)

```
[![Health](https://phpackages.com/badges/bambamboole-filament-settings/health.svg)](https://phpackages.com/packages/bambamboole-filament-settings)
```

###  Alternatives

[a909m/filament-statefusion

Filament StateFusion is a powerful FilamentPHP plugin that seamlessly integrates Spatie Laravel Model States into the Filament admin panel. This package provides an intuitive way to manage model states, transitions, and filtering within Filament, enhancing the user experience and developer productivity.

295.8k1](/packages/a909m-filament-statefusion)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
