Download the PHP package lutfi-nur/query-builder without Composer

On this page you can find all versions of the php package lutfi-nur/query-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package query-builder

LutfiNur/QueryBuilder

A fluent datatable query builder for Laravel with Yajra Datatables. Supports MySQL and PostgreSQL with automatic driver detection.

Requirements

Installation

No service provider registration or config publishing required. This package is zero overhead — classes are only loaded when dtBuilder() is called.

Quick Start

1. Add the Trait to Your Model

2. Create a Datatable Method

3. Define a Route

API Reference

Column Builders

Method Description
addDateColumn($column, $format, $alias) Date format (DATE_FORMAT / TO_CHAR)
addBoolColumn($column, $true, $false, $trueClass, $falseClass) Boolean column → generates {col}_str + {col}_class
addFileColumn($alias, $baseUrl, $source, $default) File link with NULL fallback (IFNULL / COALESCE)
addConcatColumn($alias, $prefix, $column) CONCAT without fallback
addAliasColumn($alias, $expression) Alias from a joined table
addRawColumn($alias, $expression, $searchable) Raw SQL expression. Set $searchable = false to exclude from global search

Filters

All filters read from $request->input('filter').

Method Description
applyRangeFilter($model, $request, $column, $dbColumn?) Range filter using filter[{col}_dari] and filter[{col}_sampai]
applyExactFilters($model, $request, $columns) Exact match filter (parameterized, SQL injection safe)
applyNullFilter($model, $request, $column, $filterParam) NULL / NOT NULL filter. filter[$param] == 1 → whereNotNull, otherwise whereNull

Build

Method Description
buildSelect() Returns an Eloquent Builder with table.* + all computed columns
buildDatatable($model) Returns a Yajra Datatable JSON response with global search

Getters

Method Description
grammar() Get the current GrammarInterface instance for building driver-aware expressions
getColumns() Get all registered column expressions
getModelFilter() Get the list of searchable aliases
getTable() Get the table name

Date Format

Format strings use MySQL specifiers as the standard. For PostgreSQL, conversion is automatic.

MySQL PostgreSQL Description
%Y YYYY Year (4-digit)
%y YY Year (2-digit)
%m MM Month (01-12)
%d DD Day (01-31)
%e FMDD Day (1-31, no leading zero)
%H HH24 Hour (00-23)
%h HH12 Hour (01-12)
%i MI Minute (00-59)
%s SS Second (00-59)
%M FMMonth Full month name
%b Mon Abbreviated month
%W FMDay Full weekday name
%a Dy Abbreviated weekday
%p AM AM/PM

Database Support

Driver Status Grammar Class
MySQL Supported MySqlGrammar
MariaDB Supported MySqlGrammar
PostgreSQL Supported PostgresGrammar

The database driver is automatically detected from the active Laravel database connection.

Custom Grammar

To support additional drivers (e.g., SQL Server), create a class that implements GrammarInterface and register it in your AppServiceProvider::boot():

Generated SQL Examples

MySQL

PostgreSQL

How It Works

  1. No ServiceProvider — Pure PSR-4 autoload. Classes are only loaded by PHP when first used.
  2. Auto driver detection — Grammar is resolved from DB::connection()->getDriverName() at build time.
  3. Global search — Covers all computed (searchable) columns + model $fillable columns.
  4. Parameterized queries — All search and filter values use parameter binding (SQL injection safe).
  5. searchable flag — Columns added with searchable: false are included in SELECT but excluded from global search. Useful for IDs, CSS classes, or display-only expressions.

License

MIT


All versions of query-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
yajra/laravel-datatables-oracle Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lutfi-nur/query-builder contains the following files

Loading the files please wait ...