Skip to main content
Utility functions cover a wide range of operations: array manipulation, type casting, date arithmetic, conditional logic, and more.

Array functions

Fluent API methodFQL functionDescription
arrayCombine($keys, $values)ARRAY_COMBINE(keys, values)Combine a keys array and a values array into an associative array
arrayFilter($field)ARRAY_FILTER(field)Remove empty/null entries from an array
arraySearch($field, $needle)ARRAY_SEARCH(field, needle)Return the key of the first matching value
arrayMerge($field1, $field2)ARRAY_MERGE(field1, field2)Merge two arrays into one
colSplit($field, $format, $key)COL_SPLIT(field, format, key)Expand an array field into separate columns
$query
    ->arrayCombine('fieldWithKeys', 'fieldWithValues')->as('combined')
    ->arrayFilter('tags')->as('cleanTags')
    ->arraySearch('categories', 'electronics')->as('catKey')
    ->arrayMerge('list1', 'list2')->as('merged')
    ->colSplit('items', 'item_%index', 'id');