PHPackages                             marifyahya/laravel-eloquent-filter - 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. marifyahya/laravel-eloquent-filter

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

marifyahya/laravel-eloquent-filter
==================================

Elegant search and filter library for Laravel Eloquent

v1.3.0(1mo ago)02MITPHPPHP ^8.2

Since Jun 1Pushed 1mo agoCompare

[ Source](https://github.com/marifyahya/laravel-eloquent-filter)[ Packagist](https://packagist.org/packages/marifyahya/laravel-eloquent-filter)[ Docs](https://github.com/marifyahya/laravel-eloquent-filter)[ RSS](/packages/marifyahya-laravel-eloquent-filter/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

Laravel Eloquent Filter
=======================

[](#laravel-eloquent-filter)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2028c3c7b00fba4cb5dc9310028828f5cb5a10b713d6b5a4aeaf316af737493f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6172696679616879612f6c61726176656c2d656c6f7175656e742d66696c7465722e737667)](https://packagist.org/packages/marifyahya/laravel-eloquent-filter)[![Total Installs](https://camo.githubusercontent.com/ea7b6d8d37b779d5e473f645ebc0a5f7d6492a37cc42707780b1746f9003b5ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6172696679616879612f6c61726176656c2d656c6f7175656e742d66696c7465723f6c6162656c3d696e7374616c6c732663616368655365636f6e64733d33363030)](https://packagist.org/packages/marifyahya/laravel-eloquent-filter)[![License](https://camo.githubusercontent.com/6fd2878463941e934566bb276dba8bedd43daf267c0f1d21f63b775457a853bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6172696679616879612f6c61726176656c2d656c6f7175656e742d66696c7465722e737667)](LICENSE)[![Tests](https://camo.githubusercontent.com/3ab4882a1b7d64e5eb5168ad0b0b9cdfd53f59f114ee5f727958504214a5789c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d70617373696e672d627269676874677265656e2e737667)](https://github.com/marifyahya/laravel-eloquent-filter)

Elegant, whitelisted search and filter utilities for Laravel Eloquent models.

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

[](#requirements)

- PHP `^8.2`
- Laravel components `^11.0`, `^12.0`, or `^13.0`
- MySQL, PostgreSQL, SQLite, or SQL Server

Installation
------------

[](#installation)

```
composer require marifyahya/laravel-eloquent-filter
```

Optionally publish the request stub:

```
php artisan vendor:publish --provider="Marifyahya\EloquentFilter\EloquentFilterServiceProvider" --tag=request
```

The package is configured from each model or from the second argument passed to `filter()`. No global config options are required.

Quick Start
-----------

[](#quick-start)

Add the `HasEloquentFilter` trait and define the allowed fields on your model:

```
