Field Filters
Not 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
Not In
Definition
Filter::field('name', [FilterType::NOT_IN]);
Array/Object Structure
target
string
requiredvalue
array,min:1
requiredvalue.*
string|int|float
requiredExample
$filter = [
'type' => '$notIn',
'target' => 'name',
'value' => ['Nuno', 'Maduro',]
];
$sql = Person::filter([$filter])->toRawSql();
SQL
select * from "people" where "people"."name" not in ('Nuno', 'Maduro')
Modifiers
Null
select * from "people"
where "people"."name" not in ('Nuno', 'Maduro')
and "people"."name" is not null