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