jumper423 / laravel-filter
Laravel фильтрация по полям
1.0.4
2016-10-28 16:20 UTC
Requires
- php: >=5.5.9
- illuminate/database: 5.*
- illuminate/support: 5.*
README
Composer
Pull this package in through Composer. (development version dev-master
)
{
"require": {
"jumper423/laravel-filter": "~1.0"
}
}
$ composer update
##Пример
use jumper423\LaravelTrait\Filter; class Post{ use Filter; protected $filterColumns = [ 'user_name' => 'user.first.name' ]; } $posts = Post::join('users', 'users.id', '=', 'posts.user_id') ->filter([ [ 'name' => 'user_name' 'value' => 'Вася' ] ])->get();