laravel-mongodb - Issue #3163: [Feature Request] $user->getChanges(), date transformation not being applied

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Works as Designed
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: Laravel
    • None
    • 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?
    • None
    • None
    • None
    • None
    • None
    • None

      masterbater has created Issue #3163: [Feature Request] $user->getChanges(), date transformation not being applied in laravel-mongodb. This Jira ticket was filed by GromNaN

      Issue Text:
      ```php
      $validatedData = $request->validated();
      $update = $user->update($validatedData);

      return response()->json(['message' => 'success', 'data' => $user->getChanges()], Response::HTTP_OK);
      ```

      This returns

      {"message":"success","data":{"fname":"fname","updatedAt":{"$date":{"$numberLong":"1727594198505"}}}}

      I didnt test with default timestamp fields since I have custom fields, but the transformation should work especially with eloquent. Let me
      const CREATED_AT = 'createdAt';
      const UPDATED_AT = 'updatedAt';

              Assignee:
              Jérôme Tamarelle
              Reporter:
              TPM Jira Automations Bot
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: