PHPackages                             laravel-freelancer-nl/fluentaql - 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. laravel-freelancer-nl/fluentaql

ActiveLibrary

laravel-freelancer-nl/fluentaql
===============================

PHP AQL Query Builder

2.1.1(4y ago)1216.3k↓38.2%2[4 PRs](https://github.com/LaravelFreelancerNL/fluentaql/pulls)1MITPHPPHP ^8.0CI passing

Since Oct 12Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/LaravelFreelancerNL/fluentaql)[ Packagist](https://packagist.org/packages/laravel-freelancer-nl/fluentaql)[ GitHub Sponsors](https://github.com/LaravelFreelancerNL)[ RSS](/packages/laravel-freelancer-nl-fluentaql/feed)WikiDiscussions next Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (32)Used By (1)

FluentAQL
=========

[](#fluentaql)

Fluent PHP query builder for [ArangoDB’s](https://www.arangodb.com) Query Language ([AQL](https://www.arangodb.com/docs/stable/aql/)).

[![Latest Version](https://camo.githubusercontent.com/777fad475555fdcaa008fe72230d7644ac26232e8b29ce0cb5152ea3b61d4632/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d667265656c616e6365722d6e6c2f666c75656e7461716c2f762f737461626c65)](//packagist.org/packages/laravel-freelancer-nl/fluentaql)[![Github CI tests](https://github.com/LaravelFreelancerNL/fluentaql/workflows/Continuous%20Integration/badge.svg)](https://github.com/LaravelFreelancerNL/fluentaql/workflows/Continuous%20Integration/badge.svg)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5ef9f31e743c5e1ae872762cb94ce32863bce1aebca68faec79c6b6e46f7e921/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c61726176656c467265656c616e6365724e4c2f666c75656e7461716c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6e657874)](https://scrutinizer-ci.com/g/LaravelFreelancerNL/fluentaql/?branch=next)[![Code Coverage](https://camo.githubusercontent.com/0ee7597ef84a9501b9a8534a5ce2dc60eaa0c77004cb2dfe88f7705b5cc472b2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c61726176656c467265656c616e6365724e4c2f666c75656e7461716c2f6261646765732f636f7665726167652e706e673f623d6e657874)](https://scrutinizer-ci.com/g/LaravelFreelancerNL/fluentaql/?branch=next)[![Total Downloads](https://camo.githubusercontent.com/c4aa38f6df25298238232edd1f2dfa82a28ff8980021fa4fef54e9d857724f48/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d667265656c616e6365722d6e6c2f666c75656e7461716c2f646f776e6c6f616473)](https://packagist.org/packages/laravel-freelancer-nl/fluentaql)[![License](https://camo.githubusercontent.com/e1437123a8512a5ce14a122ca039e31a85bd558bbef3631713f8ba30a8218f6e/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d667265656c616e6365722d6e6c2f666c75656e7461716c2f6c6963656e7365)](//packagist.org/packages/laravel-freelancer-nl/fluentaql)

Table of contents
-----------------

[](#table-of-contents)

1. [Use Cases](#purpose)
2. [Requirements](#requirements)
3. [Installation](#installation)
4. [Usage](#usage)

Purpose
-------

[](#purpose)

Using a query builder mainly makes the life of a programmer much easier. You can write cleaner code and be quicker at it. Which of course comes at the cost of application speed.

*If you need bleeding edge speed you will need to write your own queries.*

The use of a query builder has both pros and cons. It is up to you to decide what you need.

**Cons:**

1. *Sacrificing speed*
2. You still need to understand ArangoDB, AQL and the 'schema' of your database.
3. Slight variations between the query builder API and the raw AQL output which may be confusing

**Pros**

1. Programmatically compose queries (e.g. search facets).
2. Easy query decomposition
3. Dry up your code.
4. Reduce AQL syntax bugs
5. Flexible expression input
6. IDE intellisense.

Requirements
------------

[](#requirements)

FluentAQLArangoDBPHP1.x^3.6^8.0- ArangoDB regularly adds AQL functions and clauses in minor versions. So be sure to check the AQL documentation for the availability of specific features.

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

[](#installation)

You know the drill:

```
composer require laravel-freelancer-nl/fluentaql

```

Before you begin: safety first!
-------------------------------

[](#before-you-begin-safety-first)

FluentAQL is a query builder that focuses on making your life as a developer easier while maintaining the strength and flexibility of AQL. It focuses on syntax checking of the provided expressions however that is not airtight if you don't bind user input.

**Always bind user input.**

Usage
-----

[](#usage)

First fire up a new query builder then fluently add AQL clauses on top.

### Step 1: create a query builder:

[](#step-1-create-a-query-builder)

```
use LaravelFreelancerNL\FluentAQL\QueryBuilder;

...

$qb = new QueryBuilder();

```

### Step 2: compose your query:

[](#step-2-compose-your-query)

*For Example:*

```
$qb->for('i', '1..100')->filter('i', '
