Definition
Array/Object Structure
string
required
array,min:1
required
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::morphRelation('imageable', [FilterType::HAS_MORPH],
Filter::morphType('*'),
);
$filter = [
'target' => 'imageable',
'type' => '$hasMorph',
'types' => [
[
'type' => '*',
'value' => [],
],
],
];
$sql = Image::filter([$filter])->toRawSql();
SELECT *
FROM "images"
WHERE (
(
"images"."imageable_type" = 'articles'
AND EXISTS (
SELECT *
FROM "articles"
WHERE "images"."imageable_id" = "articles"."id"
)
)
OR (
"images"."imageable_type" = 'user_profiles'
AND EXISTS (
SELECT *
FROM "user_profiles"
WHERE "images"."imageable_id" = "user_profiles"."id"
)
)
)
