PHPackages                             itsmill3rtime/l5-filterable-sortable - 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. itsmill3rtime/l5-filterable-sortable

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

itsmill3rtime/l5-filterable-sortable
====================================

A trait for filtering and sorting Query Builder results, based on Laracasts/Dedicated-Query-String-Filtering

1.8.0(6y ago)06MITPHPPHP &gt;=7.1.3

Since Dec 27Pushed 6y agoCompare

[ Source](https://github.com/itsmill3rtime/l5-filterable-sortable)[ Packagist](https://packagist.org/packages/itsmill3rtime/l5-filterable-sortable)[ Docs](https://github.com/rafflesargentina/l5-filterable-sortable)[ RSS](/packages/itsmill3rtime-l5-filterable-sortable/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (4)Versions (8)Used By (0)

l5-filterable-sortable
======================

[](#l5-filterable-sortable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/73b95fc2d4088cc833357b341e04bfc8485d36d62aab52b470e4ae30a8e11830/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726166666c6573617267656e74696e612f6c352d66696c74657261626c652d736f727461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rafflesargentina/l5-filterable-sortable)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/2f25fb547d09bf1ace369fa8a8bd9b2b643a2573ef9a10f94a6e0c8acc90b455/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f726166666c6573617267656e74696e612f6c352d66696c74657261626c652d736f727461626c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rafflesargentina/l5-filterable-sortable)[![Total Downloads](https://camo.githubusercontent.com/aa1bfcefedf08fe95f85ccadf6d5909d2b6f83b39b101cc1499b0297ebcffbdc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726166666c6573617267656e74696e612f6c352d66696c74657261626c652d736f727461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rafflesargentina/l5-filterable-sortable)

A trait for filtering and sorting Query Builder strings, based on Laracasts/Dedicated-Query-String-Filtering.

Install
-------

[](#install)

Via Composer

```
$ composer require rafflesargentina/l5-filterable-sortable
```

Usage
-----

[](#usage)

Add FilterableSortableTrait to your Eloquent model so you can make use of filter() and sorter() scopes. Both apply clauses to the Builder intance that you must define as functions in separate classes. So you must add $filters and $sorters properties to your model to set those classes.

Example:

```
