Download the PHP package n7olkachev/laravel-filterable without Composer
On this page you can find all versions of the php package n7olkachev/laravel-filterable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download n7olkachev/laravel-filterable
More information about n7olkachev/laravel-filterable
Files in n7olkachev/laravel-filterable
Package laravel-filterable
Short Description Nice and simple scope for your models
License MIT
Homepage https://github.com/n7olkachev/laravel-filterable
Informations about the package laravel-filterable
Laravel Filterable Trait
Why?
This package is powered by standard Laravel scopes, instead of other similar packages,
that brings something like Filter
classes to your code, so it is much more easy to jump into.
Also, if you decide to remove this package from your project, you will stay with standard scopes
which can be used directly further.
Personally, I use this trait for faster development, combining it with $request->all()
By default, you get equality filters (where field = bar
)
and when you need to support other queries, adding new scopes
will do the trick, without changing anything except model. See examples for better understanding.
Examples
Now, we can use filter
scope to filter our queries:
Of course it supports filters with multiple keys:
Installation
You can install the package via composer:
Next, add Filterable trait and list all filterable properties:
That's all!
Testing
Credits
Sponsored by
Web agency based in Minsk, Belarus
License
The MIT License (MIT)
All versions of laravel-filterable with dependencies
illuminate/config Version ~5.1.0|~5.2.0|~5.3.0|~5.4.0
illuminate/database Version ~5.1.0|~5.2.0|~5.3.0|~5.4.0
illuminate/support Version ~5.1.0|~5.2.0|~5.3.0|~5.4.0