Download the PHP package sharifuddin/laravel-smart-filter without Composer
On this page you can find all versions of the php package sharifuddin/laravel-smart-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sharifuddin/laravel-smart-filter
More information about sharifuddin/laravel-smart-filter
Files in sharifuddin/laravel-smart-filter
Package laravel-smart-filter
Short Description Advanced smart filtering for Laravel Eloquent models with relation support and multiple filter types
License MIT
Informations about the package laravel-smart-filter
๐ Introduction
Laravel Smart Filter is a powerful and flexible filtering engine for Eloquent models.
It enables dynamic, request-driven filtering across columns and relationships โ with support for multiple operators, data types, and nested relations.
โจ Features
- โก Dynamic Filtering โ Filter data using arrays or request parameters
- ๐ Relation Filtering โ Automatically filters related models
- ๐งฉ Multiple Operators โ
=,!=,>,<,like,in,between,null, etc. - โ๏ธ Type-Aware Parsing โ Handles string, numeric, boolean, and date types
- ๐ Request Integration โ Parse filters directly from HTTP requests
- ๐งช Fully Tested & Configurable โ Comprehensive test coverage and flexible config
๐ฆ Installation
Requirements
- PHP 8.1 or higher
- Laravel 10.x, 11.x, or 12.x
Install via Composer
(Optional) Publish Configuration
๐ฏ Quick Start
1๏ธโฃ Add the Trait to a Model
๐งฉ Usage Examples
๐น Basic Filtering
๐น Filter from HTTP Request
specify allowed filters:
๐น Relation Filtering
๐น Combined Example (Controller)
โ๏ธ Configuration
config/smart-filter.php
๐งช Testing
Example test:
๐ง API Reference
โค scopeApplySmartFilters()
โค scopeFilterFromRequest()
๐งฐ Performance Tips
- Use indexed columns for frequent filters
- Prefer exact (
=) overLIKEfor faster queries - Limit filters using config:
max_filters - Always paginate large results
๐ค Contributing
Contributions are welcome!
See CONTRIBUTING.md for details.
๐ License
This package is open-sourced software licensed under the MIT License.
Laravel Smart Filter โ Powerful, Relation-Aware Filtering for Eloquent. โก
GitHub โข Packagist โข Issues โข Discussions