PHPackages                             wstam/eloquentfilter - 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. [Search &amp; Filtering](/categories/search)
4. /
5. wstam/eloquentfilter

ActiveLibrary[Search &amp; Filtering](/categories/search)

wstam/eloquentfilter
====================

This package implements easy model filtering into your Laravel models and generates HTML filters in your template

0.1(8y ago)010MITPHPPHP &gt;=5.5

Since Sep 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/wesselstam/EloquentFilter)[ Packagist](https://packagist.org/packages/wstam/eloquentfilter)[ RSS](/packages/wstam-eloquentfilter/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

EloquentFilter
==============

[](#eloquentfilter)

> EloquentFilter adds new functionalities to your Laravel Eloquent model to make filtering data easy.

Installing EloquentFilter
-------------------------

[](#installing-eloquentfilter)

You need to use Composer to install EloquentFilter into your project:

```
composer require wstam/eloquentfilter

```

Configuring (Laravel)
---------------------

[](#configuring-laravel)

Now you have to include `EloquentFilterServiceProvider` in your `config/app.php`:

```
'providers' => [
    /*
     * Package Service Providers...
     */
    WStam\EloquentFilter\EloquentFilterServiceProvider::class,
]
```

Now we need to publish the default blade views by running the following Artisan command in your terminal:

```
php artisan vendor:publish --provider="WStam\EloquentFilter\EloquentFilterServiceProvider"

```

Now you have `container.blade.php` and `filter.blade.php` in your vendor/eloquentfilter view folder. You can change the the template of the filter container and the filter itself to make it fit to your own look and feel.

How to use EloquentFilter
-------------------------

[](#how-to-use-eloquentfilter)

For an example, you want to add filtering to the Product model. Add the filtering trait to your model like this example:

```
