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>
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →