2017 © Pedro Peláez
 

library search-parser

Inno PHP Library

image

yfc/search-parser

Inno PHP Library

  • Thursday, July 19, 2018
  • by yufangcheng
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Use JavaCC instead

click me, (*1)

Install

composer require yufangcheng/search-parser

Add the provider below to config/app.app, (*2)

Inno\Lib\SearchParser\Providers\SearchParserServiceProvider::class

Then run the command, (*3)

php artisan vendor:publish

Example

http://example.com/api/users?q=id:1
http://example.com/api/users?email~"*@gmail.com"
http://example.com/api/users?id:<1,2,3>
http://example.com/api/users?id:NOT <1,2,3>
http://example.com/api/users?id:[1 TO 100]
http://example.com/api/users?q=created_at:["-3 months" TO "now"] AND id:NOT [1 TO 100] OR (email:"*@vip.patsnap.com" OR id:888)&sort=id desc&fl=id,email&with=profile

To avoid the cut off of a too long URL by browser or server

Use the optianal header named search to transmit the query string., (*4)

Field name pattern

Pattern
/\^[a-zA-Z_][a-zA-Z0-9_]*$/i

Function name pattern

Pattern
/\^[a-z]\w*$/i

Operators

Operators Meaning Supported Value Types Example

Incomplete...

The Versions

19/07 2018

dev-master

9999999-dev http://git.patsnap.com/inno/lib-php

Inno PHP Library

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url search restful

20/12 2017

0.9.9

0.9.9.0 https://github.com/yufangcheng/search-parser

A laravel plugin that allows query via a GET request

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url search restful