Field Filters
Not Like
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 Like
Definition
Filter::field('description', [FilterType::NOT_LIKE])
Array/Object Structure
target
string
requiredvalue
string|int|float
requiredExample
$filter = [
'type' => '$notLike',
'target' => 'description',
'value' => 'Symfony',
];
$sql = Project::filter([$filter])->toRawSql();
SQL
select * from "projects" where "projects"."description" NOT LIKE '%Symfony%'
Modifiers
Start
select * from "projects" where "projects"."description" NOT LIKE 'Symfony%'
End
select * from "projects" where "projects"."description" NOT LIKE '%Symfony'