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('price', [FilterType::BETWEEN_COLUMNS]);
import TypeParameterField from '/snippets/type-parameter-field.mdx';
import TargetParameterField from '/snippets/target-parameter-field.mdx';
$filter = [
'type' => '$betweenColumns',
'target' => 'price',
'value' => [
'min_allowed_price',
'max_allowed_price',
],
];
$sql = Product::filter([$filter])->toRawSql();
select
*
from
"products"
where
"products"."price" between "products"."min_allowed_price"
and "products"."max_allowed_price"
None available.
How can I help you explore Laravel packages today?