canopytax / jql
Installs: 246
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 24
Forks: 0
pkg:composer/canopytax/jql
Requires
- php: >=5.6
 - illuminate/database: ^5.1
 
Requires (Dev)
- phpunit/php-code-coverage: 3.3.*
 - phpunit/phpunit: 5.3.*
 - squizlabs/php_codesniffer: 2.6.*
 
This package is not auto-updated.
Last update: 2024-08-03 16:37:11 UTC
README
JQL - Json Query Language
JQL is a json query language.
A single query looks like:
{
  "field": "model.fieldname",
  "operator": "lt",
  "value": "value"
}
Operators
lt=<,gt=>,lte=<=,gte=>=,eq==,ne=!=,beginswithendswithcontainsin
Example:
{
  "jql": [
    {
      "field": "mammals.A",
      "operator": "in",
      "value": ["A", "B", "C"]
    },
    {
      "field": "mammals.B",
      "operator": "eq",
      "value": "false"
    },
    {
      "OR": [
        {
          "field": "birds.C",
          "operator": "eq",
          "value": "true"
        },
        {
          "field": "mammals.D",
          "operator": "eq",
          "value": "true"
        },
        {
          "field": "mammals.E",
          "operator": "eq",
          "value": "true"
        },
        {
          "OR": [
            {
              "field": "dogs.F",
              "operator": "eq",
              "value": "true"
            },
            {
              "field": "dogs.G",
              "operator": "eq",
              "value": "true"
            },
            [
              {
                "field": "cats.H",
                "operator": "eq",
                "value": "true"
              },
              {
                "field": "cats.I",
                "operator": "eq",
                "value": "true"
              }
            ]
          ]
        }
      ]
    },
    {
      "field": "dogs.J",
      "operator": "eq",
      "value": "true"
    }
  ]
}
Requirements
- PHP >=5.5
 
Contributing
Contributions to the JQL package are welcome. Please note the following guidelines before submiting your pull request.
- Follow PSR-2 coding standards.
 - Write tests for new functions and added features
 
License
Canopy/JQL is licensed under the MIT License.