| Viewed 22 times

How to converts the array into a query string in laravel


How to converts the array into a query string in laravel

1 Answer
Mohammad Qandeel
Answered
0

You can use the query() helper function to converts the array into a query string in laravel

For Laravel developers, you can convert the array into a query string to use it in the URL, the query string like id=5&order=created_at

If you want to converts the array into a query string in laravel you can use the query() helper function which will return a string

Example of how to use query() helper function

use Illuminate\Support\Arr;

$array = ['id' => '5', 'order' =>'created_at'];

Arr::query($array);

Output

id=5&order=created_at

 


Related FAQ