PHP code example of netflex / query-builder

1. Go to this page and download the library: Download netflex/query-builder 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/ */

    

netflex / query-builder example snippets




use Netflex\Query\Builder;

$query = new Builder();
$query->relation('entry', 10000)
  ->where('id', '>=', 10100)
  ->where('author', '!=', null)
  ->orWhere(function ($query) {
    $query->where('id', '<', 10100)
      ->where('author', '=', 'John Doe');
  });

$items = $query->limit(100)
  ->fields(['id', 'name', 'author'])
  ->orderBy('name', 'desc')
  ->get();

$page = $query->paginate(25);