Field Filters
Null
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
Null
Definition
Filter::field('age', [FilterType::NULL]);
Filter::field('weight', [FilterType::NULL]);
Array/Object Structure
target
string
requiredvalue
true|false
requiredExample
$filters = [
[
'type' => '$null',
'target' => 'age',
'value' => true,
],
[
'type' => '$null',
'target' => 'weight',
'value' => false,
],
];
$sql = Person::filter($filters)->toRawSql();
SQL
select *
from "people"
where "people"."age" is null
and "people"."weight" is not null
Modifiers
None available.