Skip to content

Creative2LLC/filament-filter

Repository files navigation

Filament Filter

Filament Filter is a Laravel package that provides a simple and elegant way to add filters to your Filament admin panel. With Filament Filter, you can easily create filters that allow your users to search, sort, and filter your data based on specific criteria.

Installation

You can install the package via composer:

composer require creative2llc/filament-filter

Usage

To add the filter to your Filament Resource, navigate to the ListRecords class you are extending, and include the 'HasFilamentFilter' trait. Also make sure to include the getColumnsProperty() method, which will return an array of columns that you want to be searchable. The key of the array will be the database column name, and the value will be the user facing column name.

class ListPosts extends ListRecords
{

    use HasFilamentFilter;

    protected static string $resource = Post::class;

    public function getColumnsProperty(): array
    {
        return [
            'database_column' => 'User Facing Column Name',
        ];
    }

}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Query Filter builder for FilamentPHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages