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

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

bakhadyrovf/easy-filter
=======================

This package allows you to filter queries with your own methods.

v3.0.1(3y ago)237MITPHPPHP &gt;=8.0

Since Jul 10Pushed 3y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (11)Used By (0)

Easy Query Filter
=================

[](#easy-query-filter)

**This is a package that filter queries with user's custom methods.**

Dependencies
============

[](#dependencies)

- PHP &gt;= 8.0
- Laravel &gt;= 9.0

Installation
============

[](#installation)

```
composer require bakhadyrovf/easy-filter

```

Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

#### Copy the package config to your local config with the publish command.

[](#copy-the-package-config-to-your-local-config-with-the-publish-command)

```
php artisan vendor:publish --tag=easy-filter-config

```

Usage
=====

[](#usage)

### Important:

[](#important)

The namespace for filters by default `App\Filters` and each filter class before creating expects that you already have **Eloquent Model** with the namespace standards as follows:

FilterModel`App\Filters\UserFilter``App\Models\User``App\Filters\Dashboard\ArticleFilter``App\Models\Dashboard\Article``App\EloquentFilters\TagFilter``App\Models\Tag`First of all you must create filter class:

```
php artisan make:filter ArticleFilter

```

This command creates **ArticleFilter** class in your project's **app/Filters** folder.
*Also this command adds trait **Filterable** to your **Eloquent Model**.*

You can change base folder's name in your config file *(**Namespace** will be changed as well)*:

```
