Override filtering behavior
Disabling operators
Substitution
use ForestAdmin\AgentPHP\DatasourceCustomizer\CollectionCustomizer;
use ForestAdmin\AgentPHP\DatasourceToolkit\Components\Query\ConditionTree\Operators;
$forestAgent->customizeCollection(
'Customer',
function (CollectionCustomizer $builder) {
$builder->replaceFieldOperator(
'fullName',
Operators::EQUAL,
function ($value) {
[$firstName, $lastName] = explode(' ', $value);
return [
'aggregation' => 'And',
'conditions' => [
['field' => 'firstName', 'operator' => Operators::EQUAL, 'value' => $firstName],
['field' => 'lastName', 'operator' => Operators::EQUAL, 'value' => $lastName],
],
];
}
);
}
);Operators to support to enable the search
Column Type
Operator to support
Emulation
Last updated