Uploaded image for project: 'PHP ORMs'
  1. PHP ORMs
  2. PHPORM-234

Convert UTCDateTime to Carbon dates in query builder results

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • laravel-5.0.0
    • Affects Version/s: None
    • Component/s: Laravel
    • None
    • PHP Drivers
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      After PHPORM-230 (convert DateTimeInterface to UTCDateTime in queries), it seems that we should do the opposite operation to support more Laravel features out of the box.

      Laravel does not convert date string in query results, but this string can be forwarded to the Carbon date constructor.

      https://github.com/laravel/framework/blob/d16ce251beb53f46d602f5f523ba82900ae4be91/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php#L149-L150

      UTCDateTime objects are not supported by Carbon.

      https://github.com/mongodb/laravel-mongodb/pull/3105#issuecomment-2302221218 

            Assignee:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Reporter:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: