To get the clean data I have to do $orders->attributesToArray(). Do I have to do this whenever I am using where()? What is the correct way to extract the orders array out of this response data?
Reason I am asking is because I am familiar with Laravel's Eloquent methods like first() and get() and they just work straightaway without any extra methods to unwrap the results. Since the method naming convention is pretty similar in the PHP-SDK I was expecting it to work similarly.
Hi,
I made the following API call to the get a user latest order.
However the response came back like this.
To get the clean data I have to do
$orders->attributesToArray()
. Do I have to do this whenever I am usingwhere()
? What is the correct way to extract the orders array out of this response data?Reason I am asking is because I am familiar with Laravel's Eloquent methods like
first()
andget()
and they just work straightaway without any extra methods to unwrap the results. Since the method naming convention is pretty similar in the PHP-SDK I was expecting it to work similarly.Thanks.