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+.
Filter::field('age', [FilterType::NULL]);
Filter::field('weight', [FilterType::NULL]);
import TypeParameterField from '/snippets/type-parameter-field.mdx';
import TargetParameterField from '/snippets/target-parameter-field.mdx';
$filters = [
[
'type' => '$null',
'target' => 'age',
'value' => true,
],
[
'type' => '$null',
'target' => 'weight',
'value' => false,
],
];
$sql = Person::filter($filters)->toRawSql();
select *
from "people"
where "people"."age" is null
and "people"."weight" is not null
None available.
How can I help you explore Laravel packages today?