jumper423/laravel-filter

Laravel фильтрация по полям

1.0.4 2016-10-28 16:20 UTC

This package is auto-updated.

Last update: 2024-11-05 18:57:09 UTC


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();