Download the PHP package hassanalisalem/querybuilder without Composer
On this page you can find all versions of the php package hassanalisalem/querybuilder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hassanalisalem/querybuilder
More information about hassanalisalem/querybuilder
Files in hassanalisalem/querybuilder
Package querybuilder
Short Description This package is used to build a query from jQuery Query builder plugin rules.
License MIT
Homepage https://github.com/hassanalisalem/querybuilder
Informations about the package querybuilder
Laravel QueryBuilder for jQuery Query Builder
jQuery Query Builder
this package is to build query form jQuery Query Builder library, it works with laravel models, and it uses the model relations. Also it hide your table structure, so you dont need to name the filters as your table columns
Structure
Install
Via Composer
Usage
in your controller or whatever place you are building your query
in the model
you should define a public array variable named filterable. This should contain all your filters as filter id or key (from the jquery query builder filters) => filter value.
incase of ambiguous key you can add "as". so if I have table named industries and I want to query whereIn('id', [])... so the key should be 'filter_name_industries' => 'industries.id as industries'
this means that the name source is the model itself. posts means that the title is from another relation named posts (posts) should be a function in the model that returns a relation.. also comments is a function in Post that returns a relation..