PHPackages                             albetnov/laravel-filterable - 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. albetnov/laravel-filterable

ActiveLibrary

albetnov/laravel-filterable
===========================

Query String based filter for Laravel

v1.0(2y ago)017[2 PRs](https://github.com/albetnov/laravel-filterable/pulls)MITPHPPHP ^8.1CI passing

Since Aug 27Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/albetnov/laravel-filterable)[ Packagist](https://packagist.org/packages/albetnov/laravel-filterable)[ Docs](https://github.com/albetnov/laravel-filterable)[ RSS](/packages/albetnov-laravel-filterable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (15)Versions (9)Used By (0)

Query String based filter for Laravel
=====================================

[](#query-string-based-filter-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b19a5fdbe7c2e5228a4d855bc52a6ea8002a27aaafbfd74b5ca18d3c871217d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c6265746e6f762f6c61726176656c2d66696c74657261626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/albetnov/laravel-filterable)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a10ee645557ffe3e53f59ae6c10d8c312ae6c7a4fc8e6af33c53c807957513c7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c6265746e6f762f6c61726176656c2d66696c74657261626c652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/albetnov/laravel-filterable/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4b4b00e7a952bb065bd5de78d0ccf84f2f7b56ddc30392881ce9cfb4bb4973df/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c6265746e6f762f6c61726176656c2d66696c74657261626c652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/albetnov/laravel-filterable/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/dd96029b85e850c07b96408b70a7333ad056cda7372b3796d4f0a1afd21cfb50/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c6265746e6f762f6c61726176656c2d66696c74657261626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/albetnov/laravel-filterable)

A Laravel Model Filterable to automatically filter a model based on given query string

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

[](#installation)

You can install the package via composer:

```
composer require albetnov/laravel-filterable
```

Usage
-----

[](#usage)

Simply add `Filterable` trait in your model and define either `$filterableColumns` or `filterableColumns()`(if you need extra logic) to define a filterable columns:

```
