Definition

The condition filters $or, and $and are not required to be defined when allowing filters.

These filters are always allowed, due to these filters essentially being wrappers around other filters.

Array/Object Structure

value
array,min:2
required
value.*
array
required

Any other filter

Example

$filter = [
    'type'  => '$and',
    'value' => [
        [
            'type'   => '$like',
            'target' => 'content',
            'value'  => 'is awesome',
        ],
        [
            'type'   => '$like',
            'target' => 'content',
            'value'  => 'is not boring',
        ]
    ]
];
$sql = Comment::filter([$filter])->toRawSql();

SQL

select *
  from "comments"
 where (
       ("comments"."content" LIKE '%is awesome%')
    and
       ("comments"."content" LIKE '%is not boring%')
 )

Modifiers

None available.