PHP code example of exeko / laravel-simple-query-filter
1. Go to this page and download the library: Download exeko/laravel-simple-query-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/ */
exeko / laravel-simple-query-filter example snippets
/filter[column_name:operator]=something
/api/users/?filter[name:like]=john
/api/users/?filter[age:>]=18&filter[age:<]=25
/api/users/?filter[gender:<>]=male
use Illuminate\Database\Eloquent\Model;
use Exeko\QueryFilter\Filter;
class User extends Model
{
use Filter;
}
$users=User::filter($request->input('filter'))->get();