Wrong Bigint value in API request using pagination #33316
Replies: 1 comment
-
Pretty convenient, I'm actually having the same issue with using bigint on the resources. This is the actual bigint I'm trying to use: This is what I get in return: However this doesn't just occur on pagination-ed collections, it also occurs on literally any resource. At first me and a friend thought maybe PHP couldn't process the bigint but dd/die debugging it displays the correct number. Edit: After posting this a friend let me know this will happen when you serialize to json - best solution so far is to just cast to a string I suppose. He sent this as an explanation: https://tools.ietf.org/html/rfc7159#section-6 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I use pagination to return in api response and it show wrong value of bigint fields. Example below:
In model file, i cast field to string then it work
My dump value still show right int value, example
dd($items[0]->toArray())
Steps To Reproduce:
Beta Was this translation helpful? Give feedback.
All reactions