Skip to content

Carbon error: Data object from model with relationship #91

Answered by wolkenheim
alexrififi asked this question in Q&A
Discussion options

You must be logged in to vote

Same here. I spent a few hours with this. I assume that nested relations are somehow normalized to arrays. So that means Carbon objects in Laravel models are serialized to strings with Carbon´s toIsoString() method. Does this help?
#[WithCast(DateTimeInterfaceCast::class, format: "Y-m-d\TH:i:s.u\Z")]

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@alexrififi
Comment options

@wolkenheim
Comment options

@alexrififi
Comment options

Answer selected by alexrififi
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Slund
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants