PHPackages                             hamza-wakrim/laro-filters - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. hamza-wakrim/laro-filters

ActiveLib[Database &amp; ORM](/categories/database)

hamza-wakrim/laro-filters
=========================

Laro Filters adds custom filters automatically to your Eloquent Models in Laravel.It's easy to use and fully dynamic, just with sending the Query Strings to it.

v1.0.6(5mo ago)03MITPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4

Since Nov 22Pushed 5mo agoCompare

[ Source](https://github.com/Hamza-Wakrim/laro-filters)[ Packagist](https://packagist.org/packages/hamza-wakrim/laro-filters)[ Docs](https://github.com/hamza-wakrim/laro-filters)[ RSS](/packages/hamza-wakrim-laro-filters/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Laro Filters is a robust Laravel package providing an intuitive way to filter your Eloquent models using query strings. Perfect for crafting responsive APIs and complex data sets, this package seamlessly integrates with Laravel's existing Eloquent models, adding powerful and dynamic filtering capabilities with minimal setup.

Features:

- Support for complex query structures
- Easy to override conditions for custom behavior
- Harmonious integration with Laravel and Eloquent, including query builders
- Full control over filter execution and customization
- Support rate limit feature

We've tailored Laro Filters to be as flexible as you need—whether your queries are straightforward or complex. With an extensive feature set, you can implement specific functionalities unique to your application with ease.

**Note** We considered what predictable features you wanted to implement no matter simple or complex, although we have a lot of features to make able you to implement your specific something's else.

Table of content
----------------

[](#table-of-content)

- [Introduction](#microphone-introduction)
- [Installation](#electric_plug-installation)
- [Basic Usage](#book-basic-usage)
    - [Config Model](#config-model-and-set-whitelist)
    - [Use in Controller](#use-in-controller)
    - [Conditions Guidance Table](#conditions-guidance-table)
    - [Simple Examples](#simple-examples)
    - [Custom Query Filter](#custom-query-filter)
    - [Request encoded](#request-encoded)
    - [Custom Detection Condition](#custom-detection-condition)
- [Configuring](#configuring)
    - [Publish Config](#publish-config)
    - [Config](#config)
    - [Alias](#alias)
- [Query Builder](#query-builder-introduction)
- [Magic Methods](#magic-methods)
    - [Request Filter](#request-filter)
    - [Request Field Cast Filter](#request-field-cast-filter)
    - [Response Filter](#response-filter)
    - [Black List Detections](#black-list-detections)
    - [Macro Methods](#macro-Methods)
- [Rate Limiting](#rate-limiting)
    - [Configuration](#configuration)
    - [Using Rate Limiting](#using-rate-limiting)

Requirements
------------

[](#requirements)

- PHP 8.0 - 8.1 - 8.2 - 8.3 - 8.4
- Laravel 8.x - 9.x - 10.x - 11.x - 12.x (New)

### Versions Information

[](#versions-information)

Major VersionVersionStatusPHP VersionLaravel Version^4.04.5.0 - 4.x.xActive support&gt;= 8.2&gt;= 12.x^4.04.2.0 - 4.4.9Active support&gt;= 8.2&gt; 11.0 &lt;= 11.x^4.04.0.x - 4.1.5Active support&gt;= 8.0&gt;= 9.x &lt;= 10.x^3.03.2.x - 3.4.xEnd of life&gt;= 8.0&gt;= 9.x^3.03.0.0 - 3.0.5End of life&gt;= 7.4.0&gt;= 5.6.x &lt;= 8.x^2.02.0.0 - 2.6.7End of life&lt;= 7.4.0&gt;= 5.x &lt;= 5.4🎤 Introduction
--------------

[](#microphone-introduction)

Conceivably, you would face challenges if you've done a task as an end-point in which there are some queries with many advanced options.

Let's say we want to make an advanced search page with multiple filter options.

[![](https://raw.githubusercontent.com/hamza-wakrim/laro-filters/master/Aban-21-1402%2014-27-04.gif)](https://raw.githubusercontent.com/hamza-wakrim/laro-filters/master/Aban-21-1402%2014-27-04.gif)

### A simple implementation without Laro Filters

[](#a-simple-implementation-without-laro-filters)

The Resource URI would be look like:

```
/users/index?age_more_than=25&gender=male&created_at=25-09-2019

```

And a simple implementation in the Controller would look like :

```
