PHP code example of ensi / laravel-query-builder-helpers

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

    

ensi / laravel-query-builder-helpers example snippets


use Ensi\QueryBuilderHelpers\Filters\StringFilter;

StringFilter::make('name')->contain()->endWith()->empty();

NumericFilter::make('rank')->exact()->empty()->gt()->lt();

$this->allowedFilters([
    ...NumericFilter::make('rank')->exact()->empty()->gt()->lt(),
]);

...ExtraFilter::nested('page', [
    ...InputFilter::make('title', 'page_title')->empty()->exact()->contain(),
]),

'suffixes' => [
    'equal' => '',
    'greater' => '_gt',
    'less' => '_lt',
    ...
],

'like_operator' => 'LIKE',

->skip(fn () => DB::getDriverName() === 'sqlite', 'db driver does not support this test');