PHPackages                             yared/laravel-smart-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. yared/laravel-smart-filter

ActiveLibrary

yared/laravel-smart-filter
==========================

Automatically convert HTTP query parameters into Eloquent query filters for Laravel APIs

00PHP

Since Mar 8Pushed 1w agoCompare

[ Source](https://github.com/yared-ayele-debela/laravel-smart-filter)[ Packagist](https://packagist.org/packages/yared/laravel-smart-filter)[ RSS](/packages/yared-laravel-smart-filter/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Smart Filter
====================

[](#laravel-smart-filter)

A professional Laravel package that automatically converts HTTP query parameters into Eloquent query filters. Eliminate repetitive filtering logic in your Laravel APIs.

Instead of writing manual filtering logic in controllers, simply write:

[![Products list with filter buttons and results table](docs/images/demo-screenshot.png)](docs/images/demo-screenshot.png)*Screenshot: Products page with quick filter links (All, Price &gt; 100, Search, Category, Sort, etc.) and a table displaying filtered results.*

```
Product::filter()->get();
```

The package automatically parses request query parameters and applies filters.

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

[](#installation)

```
composer require yared/laravel-smart-filter
```

The package supports Laravel auto-discovery. For manual registration, add the service provider to `config/app.php`:

```
'providers' => [
    // ...
    Yared\SmartFilter\SmartFilterServiceProvider::class,
],
```

### Publish Configuration (Optional)

[](#publish-configuration-optional)

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

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

[](#quick-start)

### 1. Add the Trait to Your Model

[](#1-add-the-trait-to-your-model)

```
