Weave 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 Sieve

Laravel Sieve Laravel Package

ukfast/laravel-sieve

ukfast/laravel-sieve adds declarative, reusable filtering and sorting to Laravel Eloquent queries, letting you map request query parameters to model scopes for cleaner, safer list endpoints and APIs.

View on GitHub
Deep Wiki
Context7

A library to handle filtering and sorting for Laravel APIs

Frequently asked questions about Laravel Sieve
What is ukfast/laravel-sieve used for?
It is a Laravel package for declarative filtering and sorting of Eloquent queries. It lets you map request query parameters to model scopes so list endpoints and APIs stay cleaner and more reusable. It is aimed at Laravel applications that need consistent, safe filtering without hand-writing query logic in every controller.
How do I install ukfast/laravel-sieve?
Install it with Composer using composer require ukfast/laravel-sieve. Then follow the README for Laravel package discovery, any config publishing step, and the filter and sort definitions for your models. Confirm the package version matches your Laravel and PHP constraints before adding it to production.
Which Laravel and PHP versions does laravel-sieve support?
The provided evaluation notes that v2.0.0 targets PHP 8.5 and Laravel 13, while v1.2.0 is the prior line. That suggests older PHP and Laravel versions may require v1.x or a host upgrade. Always check composer.json constraints for the exact supported matrix before installing.
How do I map query parameters to Eloquent model scopes?
Define the allowed filter and sort keys for each model, then map each key to a scope or explicit column. Reject unknown parameters rather than passing them through to the query. This whitelist approach keeps list endpoints predictable and prevents accidental data exposure.
Can laravel-sieve handle sorting as well as filtering?
Yes. The package is described as handling both filtering and sorting for Laravel APIs. You can expose approved sort keys while keeping the query construction out of your controllers. Check the README for the exact sort definition syntax.
Is laravel-sieve safe to use in production APIs?
It can be, provided you whitelist filter and sort keys, authorize access to list endpoints, and avoid exposing sensitive columns. The package reduces hand-written query code, but it does not replace request validation or application-level authorization. Review the supported Laravel version and test the endpoints before production rollout.
How should I test filtering and sorting with laravel-sieve?
Use Laravel feature tests that call your list endpoints with representative query strings and assert the JSON response and, where useful, the generated SQL. Cover unknown filters, unauthorized sorts, and empty results as well as happy paths. The provided context does not describe a package-specific fake, so verify the README for any test helpers.
What are alternatives to ukfast/laravel-sieve?
Common alternatives include Spatie Laravel Query Builder, Eloquent Filter packages, and hand-written local scopes. Choose based on how much declarative configuration you want versus explicit controller code. Laravel-sieve is a good fit when you want reusable query-parameter mapping without adopting a larger query-builder layer.
Is ukfast/laravel-sieve actively maintained?
The package is maintained by ANS Group, a UK managed-hosting provider, which is a positive signal because the maintainer is also a consumer. The evaluation notes a small contributor base, so check recent releases and issue-response times for your risk tolerance. Pin a tested version and review changelogs before major upgrades.
Is laravel-sieve a ManageSieve mail filter client?
Based on the package overview, it is a Laravel library for filtering and sorting Eloquent API queries, not the ManageSieve mail protocol. A supplied technical evaluation references ManageSieve RFC 5804 and RFC 5228, so verify the README and source if you need mail-rule management rather than API query filtering. Do not assume mail-server integration from the package name alone.
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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource