PHPackages                             guiu/filament-filter-presets - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. guiu/filament-filter-presets

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

guiu/filament-filter-presets
============================

A Filament plugin to save and load filter presets

v1.0.1(1y ago)8151MITPHPPHP ^8.1CI failing

Since Jun 30Pushed 1y agoCompare

[ Source](https://github.com/gerardguiu/filament-filter-presets)[ Packagist](https://packagist.org/packages/guiu/filament-filter-presets)[ RSS](/packages/guiu-filament-filter-presets/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (8)Versions (3)Used By (0)

Filament Filter Presets
=======================

[](#filament-filter-presets)

[![Latest Version on Packagist](https://camo.githubusercontent.com/271d3e710d3082ae43e3251f6f98a2eaff5d236c358f93015c1186296fc75ab9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f677569752f66696c616d656e742d66696c7465722d707265736574732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/guiu/filament-filter-presets)[![GitHub Tests Action Status](https://camo.githubusercontent.com/4766417e759af14f83b4f0b12f6173cd8e38138851172cc2dda10a7696873cc8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f677569752f66696c616d656e742d66696c7465722d707265736574732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/guiu/filament-filter-presets/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/afcb8458613b0aeff3da4ebb15d60a02b424bab2105e429bc9b843198992fecb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f677569752f66696c616d656e742d66696c7465722d707265736574732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/guiu/filament-filter-presets/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/77a4762e2104d51a8d6c6f40cc2d660fffc677cd106e8d2e519998cbebc6a04e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f677569752f66696c616d656e742d66696c7465722d707265736574732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/guiu/filament-filter-presets)

[![Filter Presets Overview](art/filter-preset.png)](art/filter-preset.png)

This package allows users to save and load predefined filter configurations in Filament resources. It is especially useful when:

- You need quick access to specific combinations of filters that you frequently use
- You want to create predefined filters for different scenarios or use cases
- You wish to set default filters that are automatically applied when a list is loaded
- You want to share filter configurations among different users of the system

With this module, you can:

- Save your custom filters with a name and description
- Quickly load previously saved filters
- Set default filters
- Manage your saved filters (delete, edit, set as default)

### Step by Step

[](#step-by-step)

1. [![Step 1 - Select Filters](art/1.png)](art/1.png)
2. [![Step 2 - Save Preset](art/2.png)](art/2.png)
3. [![Step 3 - Load Preset](art/3.png)](art/3.png)

Prerequisites
-------------

[](#prerequisites)

Before installing this package, make sure your project meets the following requirements:

- PHP 8.1 or higher
- Laravel 10.0 or higher
- Filament 3.0 or higher

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

[](#installation)

1. Install the package via composer:

```
composer require guiu/filament-filter-presets
```

2. Publish and run the migrations:

```
php artisan vendor:publish --tag=filament-filter-presets-migrations
php artisan migrate
```

3. Optionally, you can publish the translations:

```
php artisan vendor:publish --tag=filament-filter-presets-translations
```

Usage
-----

[](#usage)

1. Add the `HasFilterPresets` trait to your List Resource page (not in the main Resource):

```
namespace App\Filament\Resources\YourResource\Pages;

use Filament\Resources\Pages\ListRecords;
use Guiu\FilamentFilterPresets\Traits\HasFilterPresets;

class ListYourResource extends ListRecords
{
    use HasFilterPresets;

    protected function getHeaderActions(): array
    {
        return [
            Actions\CreateAction::make(),
            ...static::getFilterPresetHeaderActions(),
        ];
    }
}
```

Important:

- The trait must be added to the List class that extends `ListRecords`
- Add the filter preset actions in the `getHeaderActions()` method (NOT in the table configuration)
- Do NOT add the trait to the main Resource class

Features
--------

[](#features)

- Save filters with name and description
- Mark filters as default
- Load saved filters
- Manage filters (delete, set as default)

Advanced Customization
----------------------

[](#advanced-customization)

### Button Customization

[](#button-customization)

You can customize the appearance of buttons by overriding the following methods:

```
protected static function getSaveFilterButtonLabel(): string
{
    return 'Save filter';
}

protected static function getLoadFilterButtonLabel(): string
{
    return 'Load filter';
}

protected static function getSaveFilterModalTitle(): string
{
    return 'Save filter configuration';
}

protected static function getLoadFilterModalTitle(): string
{
    return 'Load filter configuration';
}
```

### Integration with Other Plugins

[](#integration-with-other-plugins)

You can integrate this package with other Filament plugins. For example, with the export plugin:

```
use Filament\Tables\Actions\ExportAction;

public static function table(Table $table): Table
{
    return $table
        ->headerActions([
            ...static::getFilterPresetActions(),
            ExportAction::make()
                ->beforeExporting(function (Builder $query) {
                    // Apply saved filters before exporting
                    if ($preset = static::getDefaultPreset()) {
                        $query = static::applyPresetFilters($query, $preset);
                    }
                    return $query;
                })
        ]);
}
```

### Custom Actions

[](#custom-actions)

You can add custom actions to presets:

```
protected static function getFilterPresetActions(): array
{
    return [
        ...parent::getFilterPresetActions(),
        Action::make('duplicatePreset')
            ->label('Duplicate')
            ->icon('heroicon-o-duplicate')
            ->action(fn (FilterPreset $record) => static::duplicatePreset($record)),
    ];
}
```

Troubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

1. **Filters are not saving correctly**

    - Verify that you have run the migrations
    - Check that you have write permissions to the database
    - Make sure filters don't contain too large data
2. **Buttons don't appear**

    - Verify that you have added the `HasFilterPresets` trait
    - Check that you included `...static::getFilterPresetActions()` in table actions
    - Clear Laravel cache: `php artisan cache:clear`
3. **Error loading default filters**

    - Verify that the default filter exists
    - Check that filter fields still exist in the model
    - Clear config cache: `php artisan config:clear`

### Solutions

[](#solutions)

```
# Regenerate composer autoload
composer dump-autoload

# Clear all caches
php artisan optimize:clear

# Verify database integrity
php artisan migrate:status

# If needed, refresh migrations (CAUTION: this will delete data!)
php artisan migrate:fresh
```

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

[](#contributing)

If you want to contribute to the development of this package, please:

1. Fork the repository
2. Create a branch for your feature (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

License
-------

[](#license)

This package is licensed under the MIT license.

Support
-------

[](#support)

If you discover any issues or have questions, please create an issue on GitHub.

---

**Made with ❤️ for the Filament community**

☕ Buy me a coffee
-----------------

[](#-buy-me-a-coffee)

If you like this project and it has been useful to you, you can buy me a coffee! ☕

[![Buy me a coffee](https://camo.githubusercontent.com/df32760751a63bb0d960dd1fcdf54febf52aea6c8600b7a9fdbb36eeb73d9774/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275792532306d6525323061253230636f666665652d2545322539382539352d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](https://coff.ee/gerardguiu)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance49

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

2

Last Release

368d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c733fe02ef7efabb7565d33a823a7a25cf560b6a845c27c572fcef6f5c6b3ae?d=identicon)[gerardguiu](/maintainers/gerardguiu)

---

Top Contributors

[![gerardguiu](https://avatars.githubusercontent.com/u/5679102?v=4)](https://github.com/gerardguiu "gerardguiu (1 commits)")

---

Tags

laraveluifilterstablesfilamentpresets

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/guiu-filament-filter-presets/health.svg)

```
[![Health](https://phpackages.com/badges/guiu-filament-filter-presets/health.svg)](https://phpackages.com/packages/guiu-filament-filter-presets)
```

###  Alternatives

[ysfkaya/filament-phone-input

A phone input component for Laravel Filament

3161.3M25](/packages/ysfkaya-filament-phone-input)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[slimani/filament-media-manager

A media manager plugin for Filament.

126.9k](/packages/slimani-filament-media-manager)[promethys/revive

A 'RecycleBin' page where users can restore or delete permanently soft-deleted models.

162.9k](/packages/promethys-revive)

PHPackages © 2026

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