Closed grafxflow closed 5 years ago
Issue has been sorted.
Hi @grafxflow ,
Good to see that you solved this issue.
Anyway, I will give my thoughts about this issue here so it will be helpful for others.
Long back I also faced this issue when I used this component with Laravel.
In the below code, you can see how to decode the json string to object or array style and how to access them.
<?php
// $queryParams = $request->queryParams;
$queryParams = '{"sort":[],"filters":[],"global_search":"","per_page":10,"page":1}';
// if you want to use object style
$objectMode = json_decode($queryParams);
var_dump($objectMode->sort);
// if you want to use array style
$arrayMode = json_decode($queryParams,true);
var_dump($arrayMode["sort"]);
?>
Hope this helps you, as well as others in future. I will close this issue now.
Cheers, Ruby.
Is there a way to parse the queryParams in php via Laravel from the array to object.
I have tried...
But I get an object which contains the arrays inside.