I'm using Laravel 5.4 and Axios to make async requests to my backend and retrieve data based on the get request parameters of my api endpoint.
I can see in inspector I'm making the following request to the server:
https://website.com/api/users?page=1&sort=%7B%22fieldName%22:%22lname%22,%22order%22:%22asc%22%7D&filter=
Which decodes to:
https://website.com/api/users?page=1&sort={"fieldName":"lname","order":"asc"}&filter=
Looks like I can successfully get pieces of the query via:
return $request->query('sort');
which returns:
data:
fieldName: "lname"
order: "asc"
But when I use:
return $request->query('sort.fieldName');
I don't get anything. Should I not be using the dot notation? How do I get each key / value pair of the sort input? Thanks for any help!