A collection of easy-to-use filters with clause conditions to Filament

Overview

Filament Advanced Filter

AdvancedFilters

A collection of easy-to-use filters with clause conditions to Filament

Installation

Install the package via composer (requires filament >= 2.10.40)

composer require webbingbrasil/filament-advancedfilter

Optionally you can publish the translation files

php artisan vendor:publish --tag="filament-advancedfilter-translations"

Available Filters

BooleanFilter

Filter records by boolean column:

use Webbingbrasil\FilamentAdvancedFilter\Filters\BooleanFilter;

BooleanFilter::make('is_active')

In some cases you can have a nullable column, the BooleanFilter can handle nulls in different ways:

  • Treats nulls as Unknown
  • Treats nulls as True
  • Treats nulls as False

by default nulls are treated as unknown and hidden

BooleanFilter::make('is_active'')->nullsAreUnknown();
BooleanFilter::make('is_active'')->nullsAreTrue();
BooleanFilter::make('is_active'')->nullsAreFalse();
BooleanFilter::make('is_active'')->showUnknowns();
BooleanFilter::make('is_active'')->hideUnknowns();

DateFilter

Filter records by date/timestamp column:

use Webbingbrasil\FilamentAdvancedFilter\Filters\DateFilter;

DateFilter::make('published_at')

This filter allows users to search records in the following conditions:

  • Is equal/not equal to user's input

  • Is on or after/before user's input

  • Is more/less than user's input

    the user has the option to choose a time interval (day, week, month, year) in the future/past, for example:

    • more than 3 days from now
    • more than 4 months ago
    • less than 5 weeks from now
    • less than 6 days ago
    • more than 1 year ago
  • Is between user's input

  • Is set/not set

NumberFilter

Filter records by numeric column:

use Webbingbrasil\FilamentAdvancedFilter\Filters\NumberFilter;

NumberFilter::make('quantity')

This filter allows users to search records in the following conditions:

  • Is equal/not equal to user's input
  • Is on or after/before user's input
  • Is more than/less than user's input
  • Is between user's input
  • Is set/not set

TextFilter

Filter records by text column:

use Webbingbrasil\FilamentAdvancedFilter\Filters\NumberFilter;

TextFilter::make('name')

This filter allows users to search records in the following conditions:

  • Is equal/not equal to user's input
  • Starts/not starts with user's input
  • Ends/not ends with user's input
  • Contains/not contains user's input
  • Is set/not set

Credits

License

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

You might also like...
A query database collection for use with Laravel Pipeline

A query database collection for use with Laravel Pipeline This package contains a collection of class that can be used with Laravel Pipeline. Let's se

A simple profile management page for Filament. ✨
A simple profile management page for Filament. ✨

A simple profile page for Filament. This package provides a very simple Profile page that allows the current user to manage their name, email address

Add a general-purpose tools page to your Filament project. 🛠
Add a general-purpose tools page to your Filament project. 🛠

Add a general-purpose tools page to your Filament project. Installation You can install the package via Composer: composer require ryangjchandler/fila

 The Most Popular JavaScript Calendar as a Filament Widget 💛
The Most Popular JavaScript Calendar as a Filament Widget 💛

The Most Popular JavaScript Calendar as a Filament Widget 💛 Features Accepts all configurations from FullCalendar Event click and drop events Upcomin

A single-field repeater for Filament. ⚡️

A single-field repeater for Filament. This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Insta

A convenient helper for using the laravel-seo package with Filament Admin and Forms
A convenient helper for using the laravel-seo package with Filament Admin and Forms

Combine the power of Laravel SEO and Filament PHP. This package is a convenient helper for using the laravel-seo package with Filament Admin and Forms

Easily interact and control your feature flags from Filament

Easily interact and control your feature flags from Filament

Admin user, role and permission management for Laravel Filament
Admin user, role and permission management for Laravel Filament

Filament Access Control Opinionated setup for managing admin users, roles and permissions within Laravel Filament Features Separate database table for

Build structured navigation menus in Filament.

Build structured navigation menus in Filament. This plugin for Filament provides a Navigation resource that allows to build structural navigation menu

Comments
  • Please support tag system

    Please support tag system

    Describe the ideal solution or feature request

    Maintain Semantic Versioning for the package

    Difficulty, impact, and usage score

    | Technical difficulty | User goals | Usage frequency | |--------------------| --------------------| --------------------| | small | Updating the package with composer | Daily |

    How does this tie into our current project?

    This will be useful for those who already using this great package !

    enhancement 
    opened by prageeth-peiris 1
  • Getting `ErrorException: Undefined array key

    Getting `ErrorException: Undefined array key ""` when selecting blank option

    Describe the bug The error Undefined array key "" when we select the option "Select an option" from the matcher type dropdown once another option is selected.

    To Reproduce Steps to reproduce the behavior:

    1. Go to a table with Filters
    2. Click on 'Filter Icon' image
    3. Select any matcher type from the dropdown. image
    4. Now select "Select an Option" image
    5. Following error appears: image

    Expected behavior No error should appear.

    Screenshots image

    bug 
    opened by devadattas 0
  • Using Same Filter more than once using AND/OR  operators

    Using Same Filter more than once using AND/OR operators

    Describe the ideal solution or feature request

    Adding AND/OR Button under the filter to generate another filter form to apply for the same table column

    Difficulty, impact, and usage score

    | Technical difficulty | User goals | Usage frequency | |--------------------| --------------------| --------------------| | Large | Creating More advanced Data Table Filters | Daily |

    How does this tie into our current project?

    This is an enhancement for the project

    Also if you can point me in right direction giving me some tips , I will happy to do a PR for this. I really appreciate your hard work for this package !

    Thanks !

    enhancement 
    opened by prageeth-peiris 0
Releases(v1.1.2)
  • v1.1.2(Nov 1, 2022)

    What's Changed

    • Fix for Issue #9 by @devadattas in https://github.com/webbingbrasil/filament-advancedfilter/pull/10

    New Contributors

    • @devadattas made their first contribution in https://github.com/webbingbrasil/filament-advancedfilter/pull/10

    Full Changelog: https://github.com/webbingbrasil/filament-advancedfilter/compare/v1.1.1...v1.1.2

    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Sep 22, 2022)

    What's Changed

    • Update clauses.php change Is more than to Is greater than by @rubberneck in https://github.com/webbingbrasil/filament-advancedfilter/pull/5
    • Fix for filament latest versions by @prageeth-peiris in https://github.com/webbingbrasil/filament-advancedfilter/pull/6
    • fix: conflict between clauses on datefilter by @dmandrade in https://github.com/webbingbrasil/filament-advancedfilter/pull/7
    • fix: dont apply filter if value is blank by @dmandrade in https://github.com/webbingbrasil/filament-advancedfilter/pull/8

    New Contributors

    • @rubberneck made their first contribution in https://github.com/webbingbrasil/filament-advancedfilter/pull/5
    • @prageeth-peiris made their first contribution in https://github.com/webbingbrasil/filament-advancedfilter/pull/6

    Full Changelog: https://github.com/webbingbrasil/filament-advancedfilter/compare/v1.1.0...v1.1.1

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Aug 30, 2022)

    What's Changed

    • Indicators by @marksalmon in https://github.com/webbingbrasil/filament-advancedfilter/pull/1
    • Use filament v2.15.23

    New Contributors

    • @marksalmon made their first contribution in https://github.com/webbingbrasil/filament-advancedfilter/pull/1

    Full Changelog: https://github.com/webbingbrasil/filament-advancedfilter/compare/v1.0.0...v1.1.0

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Aug 30, 2022)

Owner
Webbing Brasil
Webbing Brasil
A collection of reusable components for Filament.

A collection of reusable components for Filament. This package is a collection of handy components for you to use in all your Filament projects. It pr

Ralph J. Smit 35 Nov 16, 2022
A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell

PHPAlgorithms A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDow

Doğan Can Uçar 921 Dec 18, 2022
Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily.

DevMakerLab/Laravel-Filters Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily. Insta

DevMakerLab 19 Feb 20, 2022
Laravel basic Functions, eloquent cruds, query filters, constants

Emmanuelpcg laravel-basics Description Package with basic starter features for Laravel. Install If Builder Constants Install composer require emmanuel

Emmanuel Pereira Pires 3 Jan 1, 2022
🖖Repository Pattern in Laravel. The package allows to filter by request out-of-the-box, as well as to integrate customized criteria and any kind of filters.

Repository Repository Pattern in Laravel. The package allows to filter by request out-of-the-box, as well as to integrate customized criteria and any

Awes.io 160 Dec 26, 2022
Shell script for Git module deployment with include/exclude filters.

Deploy multiple Git repositories in an unique folder modgit is a shell script for deploying multiple Git repositories in root folder of any project, w

Johann Reinké 175 Nov 22, 2022
A demo of how to use filament/forms to build a user-facing Form Builder which stores fields in JSON.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Dan Harrin 41 Dec 24, 2022
A collection of helper functions that I use across my projects.

A collection of helper functions that I use across my projects. This package includes some of the helper functions that I tend to use in all of my pro

Ryan Chandler 33 Oct 18, 2022
Collection of classes you can use to standardize data formats in your Laravel application.

Laravel Formatters This package is a collection of classes you can use to standardize data formats in your Laravel application. It uses the Service Co

Michael Rubel 88 Dec 23, 2022
Collection of agnostic PHP Functions and helpers with zero dependencies to use as foundation in packages and other project

Collection of agnostic PHP Functions and helpers This package provides a lot of very usefull agnostic helpers to use as foundation in packages and oth

padosoft 54 Sep 21, 2022