Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Eloquent Filtering Laravel Package

indexzer0/eloquent-filtering

Filter Laravel Eloquent models using simple arrays and request data—no custom query spaghetti. Define allowed filters on your models, support complex search, and keep queries readable, maintainable, and easy to extend for APIs and dashboards.

View on GitHub
Deep Wiki
Context7

title: 'Dot Notation' version: 'v2' icon: 'period' iconType: 'solid'

Overview

You can use dot notation for filter targets.

This may be useful when wanting to filter by a join column.

Example

$sql = Author::filter(
    [
        [
            'target' => 'age',
            'type'   => '$eq',
            'value'  => 20,
        ],
    ],
    Filter::only(
        Filter::field(
            Target::alias('age', 'author_profiles.age'),
            [FilterType::EQUAL]
        ),
    )
)->join('author_profiles', function (JoinClause $join): void {
    $join->on('authors.id', '=', 'author_profiles.author_id');
})->toRawSql();
select * from "authors" inner join "author_profiles" on "authors"."id" = "author_profiles"."author_id" where "author_profiles"."age" = 20
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport