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

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

nahidulhasan/eloquent-filter
============================

Laravel eloquent query filter

1.0.2(6y ago)253033MITPHP

Since Aug 31Pushed 6y ago4 watchersCompare

[ Source](https://github.com/nahidulhasan/eloquent-filter)[ Packagist](https://packagist.org/packages/nahidulhasan/eloquent-filter)[ RSS](/packages/nahidulhasan-eloquent-filter/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (4)Used By (0)

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

[](#laravel-eloquent-filter)

[![Latest Stable Version](https://camo.githubusercontent.com/8293bf22e157db131ac788d027ef06e214f4808a116468b738785b05b313f75c/68747470733a2f2f706f7365722e707567782e6f72672f6e61686964756c686173616e2f656c6f7175656e742d66696c7465722f762f737461626c65)](https://packagist.org/packages/nahidulhasan/eloquent-filter)[![Total Downloads](https://camo.githubusercontent.com/70046c55efc117f7b76fcddff9887d851052dab6003ffaeb21a80be22f374526/68747470733a2f2f706f7365722e707567782e6f72672f6e61686964756c686173616e2f656c6f7175656e742d66696c7465722f646f776e6c6f616473)](https://packagist.org/packages/nahidulhasan/eloquent-filter)[![Latest Unstable Version](https://camo.githubusercontent.com/8ac666f1bd647fbc6d948eef60ef7c13baee7b38559c94352d8ee5f15050dfa0/68747470733a2f2f706f7365722e707567782e6f72672f6e61686964756c686173616e2f656c6f7175656e742d66696c7465722f762f756e737461626c65)](https://packagist.org/packages/nahidulhasan/eloquent-filter)[![License](https://camo.githubusercontent.com/f80e9f11bd73be422a8ae7117a59a039516534cb858f9f5a79fe12b0660983e2/68747470733a2f2f706f7365722e707567782e6f72672f6e61686964756c686173616e2f656c6f7175656e742d66696c7465722f6c6963656e7365)](https://packagist.org/packages/nahidulhasan/eloquent-filter)

This simple package helps you filter Eloquent data using query filters.

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

[](#installation)

Run the following command:

```
$ composer require nahidulhasan/eloquent-filter

```

Getting started
---------------

[](#getting-started)

Use the trait `NahidulHasan\EloquentFilter\Filterable` in your eloquent model.

Create a new class by extending the class `NahidulHasan\EloquentFilter\QueryFilters` and define your custom filters as methods with one argument. Where function names are the filter argument name and the arguments are the value.

Let's assume you want to allow to filter articles data. Please see the following code.

```
