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('options->languages', [FilterType::JSON_LENGTH]);
import TypeParameterField from '/snippets/type-parameter-field.mdx';
import TargetParameterField from '/snippets/target-parameter-field.mdx';
$filter = [
'type' => '$jsonLength',
'target' => 'options->languages',
'operator' => '>=',
'value' => 2,
];
$sql = User::filter([$filter])->toRawSql();
select * from "users"
where json_length("users"."options", '$."languages"') >= 2
None available.
How can I help you explore Laravel packages today?