PHP code example of jumper423 / laravel-filter

1. Go to this page and download the library: Download jumper423/laravel-filter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jumper423 / laravel-filter example snippets



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