Download the PHP package illusionist/searcher without Composer
On this page you can find all versions of the php package illusionist/searcher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package searcher
Illusionist Searcher
Generates database queries based on search syntax.
![packagist](https://img.shields.io/packagist/v/illusionist/searcher?style=flat-square)
![php](https://img.shields.io/packagist/php-v/illusionist/searcher?style=flat-square)
![downloads](https://img.shields.io/packagist/dt/illusionist/searcher?style=flat-square)
![license](https://img.shields.io/packagist/l/illusionist/searcher?style=flat-square)
[![Build Status](https://app.travis-ci.com/illusionist-php/searcher.svg?branch=2.x)](https://app.travis-ci.com/illusionist-php/searcher)
English | [δΈζ](README-zh_CN.md)
π Scene
- Mid background system
- Complex front-end query conditions
β¨ Features
- Zero configuration
- Compatible with laravel/scout and lorisleiva/laravel-search-string
- Support string and array syntax
- Support laravel framework
- Support thinkphp framework
π¦ Install
![packagist](https://img.shields.io/packagist/v/illusionist/searcher?style=flat-square) ![php](https://img.shields.io/packagist/php-v/illusionist/searcher?style=flat-square) ![downloads](https://img.shields.io/packagist/dt/illusionist/searcher?style=flat-square) ![license](https://img.shields.io/packagist/l/illusionist/searcher?style=flat-square) [![Build Status](https://app.travis-ci.com/illusionist-php/searcher.svg?branch=2.x)](https://app.travis-ci.com/illusionist-php/searcher)
English | [δΈζ](README-zh_CN.md)
install via composer
π¨ Usage
Add the Searchable
trait to your model's
Laravel/Lumen
ThinkPHP
Your ThinkPHP version must be >= 5.x
Now you can create a database query using the search syntax
π‘ Syntax
Note that the spaces between operators don't matter for the string syntax
Exact matches
String syntax
Array syntax
Comparisons
String syntax
Array syntax
Booleans
String syntax
Array syntax
Dates
String syntax
Array syntax
Lists
String syntax
Array syntax
Between
String syntax
Array syntax
Negations
String syntax
Array syntax
Null values
String syntax
The term NULL
is not case sensitive.
Array syntax
Searchable
The queried term must not match a boolean
or date
column, otherwise it will be handled as a boolean
or date
query.
String syntax
Array syntax
And/Or
String syntax
Array syntax
Keyword use studly-caps
format, e.g. andOr
can be written as and_or
or and-or
or and or
or AndOr
;
Relationships
String syntax
Array syntax
βοΈ Advanced
Searchable
If a query term is not boolean
or date
column, it call getQueryPhraseColumns
to get searchable columns.
If no operator is specified in the return value, like
is used by default.
For example:
Relationship
If you define a relation method, it will be used to query relationships.
Configuring searchable columns
Query terms that are not in the searchable
property will be discarded, the default value is the real columns
of the model table and the relation method name
.
Configuring boolean and date column
Laravel/Lumen
Use the casts
attribute to specify boolean and date columns.
ThinkPHP
Use the type
attribute to specify boolean and date columns.
Configuring special keywords
Implement custom keywords and symbiotic columns by overriding the getRelaSearchName
function.
selec
, order_by
, offset
is a reserved keywords, please do not conflict with the query terms.