PHP code example of atnic / eloquent-filters

1. Go to this page and download the library: Download atnic/eloquent-filters 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/ */

    

atnic / eloquent-filters example snippets


use Smartisan\Filters\Traits\Filterable;

class User extends Model
{
    use Filterable;
    
    protected $filters = App\Filters\UserFilter::class;
}

use Smartisan\Filters\Filter;

class UserFilter extends Filter
{
    public function status($code)
    {
        return $this->builder->where('status', $code);
    }
}