digitlab/search-parser
Larablocks Analysis
digitlab/search-parser works with Laravel 5 (latest release v1.0.0, Apr 22, 2016), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: Apr 22, 2016)
- 0 downloads a month (needs 10,000)
- 3 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Apr 22, 2016.
- No releases in the last 12 months.
- First released: Apr 22, 2016.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.
| Install | |
|---|---|
composer require digitlab/search-parser |
|
| Latest Version: | v1.0.0 |
| PHP: | >=5.6 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Apr 22, 2016 |
| Links: | GitHub · Packagist |
Search Parser
Parses Lucene/Google style search strings into PostgresSQL full text query string.
Installation
Install using composer:
composer require digitlab/search-parser
Add the service provider in app/config/app.php:
DigitLab\SearchParser\SearchParserServiceProvider::class,
Usage
Basic Usage
To just parse a full text query you can simply use SearchParser:
$parser = new SearchParser();
$filters = $parser->parse('string to parse');
will produce
[
'search' => 'string&to&parse'
]
Filters
To handle filters you need to extend SearchParser and add a handle function or add a pass through filter:
class CustomSearchParser extends SearchParser
{
/**
* The filters that should be returned without handlers.
*
* @var array
*/
protected $passthruFilters = ['other'];
/**
* Handle the state filter.
*
* @param mixed $state
* @return array
*/
protected function handleState($state)
{
return ['some' => $state];
}
}
$parser = new CustomSearchParser();
$filters = $parser->parse('state:pending other:string string to parse');
will produce
[
'search' => 'string&to&parse',
'some' => 'pending',
'other' => 'string'
]
Custom Query Key
You can customise the array key of the query by overriding the $queryName variable in your custom class.
class CustomSearchParser extends SearchParser
{
/**
* The name of the query in the result array.
*
* @var string
*/
protected $queryName = 'other';
}
$parser = new CustomSearchParser();
$filters = $parser->parse('string to parse');
will produce
[
'other' => 'string&to&parse'
]
License
Adaptive View is licensed under The MIT License (MIT).
Related Packages
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.0.0 | >=5.6 | ^5.0 | MIT |