Overview
This package provides the ability for you to create two different types of custom filters.You must register your filter classes in the config file
eloquent-filtering.phpField Filter
Class
Usage
Custom Filter
Class
Usage
Custom Filter Notes
Format/Validation
To specify validation messages and attributes along with the rules, you may return aIndexZer0\EloquentFiltering\Filter\Validation\ValidatorProvider from the ::format() method.
Modifiers
Adding modifiers to your custom filters is achieved by:- Implement interface:
IndexZer0\EloquentFiltering\Filter\Contracts\FilterMethod\Modifiable
- Use trait:
IndexZer0\EloquentFiltering\Filter\Traits\FilterMethod\Composables\HasModifiers
- Define
supportedModifiers()method on the filter class. - Using
$this->hasModifier('modifier_name')in theapply()implementation.
Qualifying Columns
AllFilterMethod classes have access to an EloquentContext object that allows you to qualifyColumn of the target.
- Use this method to ensure your query is prefixing the column name with the database table.
- Prevents ambiguous columns in queries where you’re also joining to another table with the same column.
- Handles using the correct table name for
->pivot()allowed field filters.

