Laravel provide a helper Arr::query() to build query string from an array, an alternative to core php http_build_query() method.
Tested with Laravel versions 5.8, 6 and 7.
Kindly check for your version on official helpers page.
array_search() is a built in PHP function that searches the array for a given value and returns the first corresponding key if successful.
Syntax array_search ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : mixed Support: (PHP 4 >= 4.
array_column() is an inbuilt PHP function which is used to get the values from a single column from the multi-dimensional array or an array of objects.