indexzer0/eloquent-filtering
Define allowed filters on your Eloquent models and apply them from simple arrays or request data—no custom query logic. Supports complex, type-based filtering for APIs and dashboards on Laravel 10+ / PHP 8.2+.
import ConditionFiltersNote from '/snippets/condition-filters-note.mdx';
import TypeParameterField from '/snippets/type-parameter-field.mdx';
$filter = [
'type' => '$or',
'value' => [
[
'type' => '$like',
'target' => 'content',
'value' => 'awesome',
],
[
'type' => '$like',
'target' => 'content',
'value' => 'boring',
]
]
];
$sql = Comment::filter([$filter])->toRawSql();
select *
from "comments"
where (
("comments"."content" LIKE '%awesome%')
or
("comments"."content" LIKE '%boring%')
)
None available.
How can I help you explore Laravel packages today?