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

Laravel Purity Laravel Package

abbasudo/laravel-purity

Laravel Purity adds elegant filtering and sorting to Eloquent queries. Just call filter() on a model query, then let clients apply complex conditions via URL query parameters (e.g., filters[title][$contains]=...). Great for clean, flexible APIs.

View on GitHub
Deep Wiki
Context7

title: Params Source prev: text: 'Rename Fields' link: '/advanced/rename' next: text: 'Allowed Fields' link: '/advanced/allowed'

Changing Params Source

By Default, Purity gets params from filters index in query params, overwrite this by passing params directly to filter or sort functions:

Filter

// this will get filters from find query params
// `GET /api/users?find[name][$eq]=John`
Post::filter(request()->query('find'))->get();
Post::filter($params)->get();

Post::filter([
            'title' => ['$eq' => 'good post']
        ])->get();
        
Post::filter([
            '$or' => [
                'title' => [
                    '$eq' => 'good post'
                ],
                'author' => [
                    'name' => [ '$eq' => 'John Doe' ],
                    'age' => [ '$gt' => 20 ],
                ],
            ],
        ])->get();

Sort

Post::sort([
            'title',
            'id:desc'
        ])->get();
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.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony