Definition
Including Relations Fields
With Defining Sub Filters
Array/Object Structure
string
required
array
array
Any other filter
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Filter::relation('comments', [FilterType::HAS])->includeRelationFields();
Filter::relation('comments', [FilterType::HAS],
Filter::only(
Filter::field('content', [FilterType::LIKE])
)
);
$filter = [
'type' => '$has',
'target' => 'comments',
'value' => [
[
'type' => '$like',
'target' => 'content',
'value' => 'awesome',
]
]
];
$sql = Project::filter([$filter])->toRawSql();
select
*
from
"projects"
where
exists (
select
*
from
"comments"
where
"projects"."id" = "comments"."project_id"
and "comments"."content" LIKE '%awesome%'
)
