Skip to content

Nested date format is different from top level in response #2129

Closed
@alexsmko

Description

@alexsmko
  • Laravel-mongodb Version: 3.7
  • PHP Version: 7.4.9

Steps to reproduce

  1. create model with propery "nested.date"
  2. return it as JsonResource for example
  3. you will date in "2020-10-23 09:12:19" format where other dates in "2020-10-23T09:12:19.512000Z"

It looks like $this->serializeDate() should be called in Mongodb/Eloquent/Model.php#L219 in order to mimic Eloquent's addDateAttributesToArray() in Eloquent/Concerns/HasAttributes.php#L168 trait

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions