Download the PHP package alifcoder/query-filter without Composer
On this page you can find all versions of the php package alifcoder/query-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alifcoder/query-filter
More information about alifcoder/query-filter
Files in alifcoder/query-filter
Package query-filter
Short Description A clean query filter builder for Laravel
License MIT
Informations about the package query-filter
🔍 Alif Query Filter
A lightweight, clean, and reusable query filtering library for Laravel Eloquent models — built to help you keep your controllers clean and your queries dynamic.
✨ Features
- Chainable, dynamic Eloquent filtering based on request input
- Filters as separate classes — fully testable and reusable
- Built-in
eq/ne/gt/gte/lt/lteoperations, search, sort, joins and soft-delete handling - Auto-generated validation rules for your filter
FormRequests - No hardcoded column names — every default column, search/sort field, join and validation rule is driven by the publishable config
- Works out-of-the-box with Laravel
📦 Requirements
- PHP >= 8.2
- Laravel ^11.0 || ^12.0 || ^13.0
🚀 Installation
Publish the config (optional, but required if you want to override any default):
To remove the published config/lang files later:
⚙️ Configuration
Everything that used to be hardcoded inside the base filter classes now lives in
config/query-filter.php, so you never need to touch the package internals to
adapt it to your schema.
Set a columns entry, default_search_fields/default_sort_fields entry, or
default_joins entry to remove it entirely if a default doesn't apply to your
table — the base class only ever registers what's present in config.
🧱 Usage
1. Create a filter
2. Apply it to a model
3. (Optional) Auto-generate validation rules
rules() will combine your fields() with config('query-filter.default_validation_fields')
and the built-in default_filters rules automatically.
🌐 Example Query
🧩 Folder Structure
📜 License
MIT © Shukhratjon Yuldashev