Skip to content Skip to footer navigation
You are reading the docs for an old version of Statamic. Consider upgrading to Statamic 6.

To Qs Modifier

Converts an array or array-like value into a query string using Laravel's Arr::query() helper method.

$params = [
'mode' => 'plaid',
'area' => [51, 52],
'hat' => null,
'transportation' => [
'bike' => true,
'delorian' => false,
],
];
<a href="/search?{{ params | to_qs }}">Search Now</a>
<a href="/search?mode=plaid&area%5B0%5D=51&area%5B1%5D=52&transportation%5Bbike%5D=1&transportation%5Bdelorian%5D=0">Search Now</a>