-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: Laravel
-
None
Laravel Database Connection automatically converts instances of DateTimeInterface into a string representing the date (source). This is done for every queries (where clauses, inserted data, updated data). DateTimeInterface instances are stored by MongoDB as empty objects: this is a frustrating user experience.
To match Laravel’s behavior and improve developer experience, DateTimeInterface will be automatically converted to UTCDateTime in every command.
This does not affect existing applications that already make this conversion before sending the command.
Laravel doesn’t convert the result back to a Carbon instance. There are many opinionated choices that would have to be made: class, immutability, timezone. So it’s better if we keep returning the UTCDateTime. For models, the conversion is done by the cast.
- is depended on by
-
PHPORM-231 Remove MongoFailedJobProvider
- Closed
-
PHPORM-235 Remove custom DatabaseTokenRepository
- Closed
- is related to
-
PHPORM-234 Convert UTCDateTime to Carbon dates in query builder results
- Closed