Field Filters
In
Introduction
Basics
- Installation
- Make Model Filterable
- Filtering Models
- Allowing Filters
- Relationships
Available Filters
- Full Filter List
- Field Filters
- Relation Filters
- Morph Relation Filters
- Condition Filters
Digging Deeper
Field Filters
In
Definition
Filter::field('name', [FilterType::IN]);
Array/Object Structure
target
string
requiredvalue
array,min:1
requiredvalue.*
string|int|float
requiredExample
$filter = [
'type' => '$in',
'target' => 'name',
'value' => ['Taylor', 'Otwell',]
];
$sql = Person::filter([$filter])->toRawSql();
SQL
select * from "people" where "people"."name" in ('Taylor', 'Otwell')
Modifiers
Null
select *
from "people"
where (
"people"."name" in ('Taylor', 'Otwell')
or
"people"."name" is null
)