Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shahidkarimi's avatar

How to remove extra fields while returning date

Using api resources, I can't manage to return only created_at. Intead carbon converts it into an about. sent_at: { date: 2018-04-28 21:05:17.000000, timezone_type: 3, timezone: UTC }

0 likes
2 replies
jekinney's avatar

Look at the carbon docs to format the date as needed. Common ones are ->diffForHumons() and toDateTimeString().

Please or to participate in this conversation.