Optional properties don't work with timestamps #188
Unanswered
alexrififi
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Shouldn't this: class SongData extends Data
{
public function __construct(
public string $title,
public Carbon|Optional|null $created_at,
) {
}
} Since you're providing a value for |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Greetings gentlemen!
and
gets the following error
Reason
ModelNormalizer forcibly adds date attributes as Data properties
laravel-data/src/Normalizers/ModelNormalizer.php
Lines 18 to 26 in 12a9155
What to do when I wanna timestamps to be optional?
Beta Was this translation helpful? Give feedback.
All reactions