1. Go to this page and download the library: Download faisal50x/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/ */
php
public function index($request, UserFilter $filter){
//It's nice and clean
$users = User::filter($filter)->get();
}
// User Filter
use Faisal50x\QueryFilter\QueryFilter;
class UserFilter extends QueryFilter {
public function status($query, $status){
return $query->whereStatus($status);
}
public function role($query, $role){
return $query->whereRole($role);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.