PHPackages                             pallares/query-syntax - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. pallares/query-syntax

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

pallares/query-syntax
=====================

1.0.1(8y ago)53.0k[3 issues](https://github.com/skyrpex/query-syntax-php/issues)PHPPHP ^5.5.9 || ^7.0

Since Jul 9Pushed 8y agoCompare

[ Source](https://github.com/skyrpex/query-syntax-php)[ Packagist](https://packagist.org/packages/pallares/query-syntax)[ RSS](/packages/pallares-query-syntax/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Query Syntax
============

[](#query-syntax)

This package allows you to parse Algolia-like queries into sort of a AST.

Installation
------------

[](#installation)

`composer require pallares/query-syntax`

Usage example
-------------

[](#usage-example)

```
$query = 'director:"Steven Spielberg" AND (category:"sci-fi" OR category:terror)';

$lexer = new Pallares\QuerySyntax\Lexer($query);

$ast = (new Pallares\QuerySyntax\Parser)->parse($lexer);
```

The AST looks like this:

```
$ast === [
    'operator' => 'and',
    'children' => [
        ['operator' => 'comparison', 'key' => 'director', 'value' => 'Steven Spielberg'],
        [
            'operator' => 'or',
            'children' => [
                ['operator' => 'comparison', 'key' => 'category', 'value' => 'sci-fi'],
                ['operator' => 'comparison', 'key' => 'category', 'value' => 'terror'],
            ],
        ]
    ],
];
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3231d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7aff591e4a3613548df0ce7473027339ec3fc8f5923ef0d136548176c007e3c4?d=identicon)[skyrpex](/maintainers/skyrpex)

---

Top Contributors

[![skyrpex](https://avatars.githubusercontent.com/u/1077520?v=4)](https://github.com/skyrpex "skyrpex (3 commits)")

---

Tags

algoliaastphpquerysql

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pallares-query-syntax/health.svg)

```
[![Health](https://phpackages.com/badges/pallares-query-syntax/health.svg)](https://phpackages.com/packages/pallares-query-syntax)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
