mercredi 29 décembre 2021

Laravel Date Mutators Nested Object

Person Collection

    {
      name: 'Jack',
      dateOfBirth: ISODate("1975-12-29T00:00:00.000Z")
      club: {
         name: 'A Club',
         joinedAt: ISODate("2020-10-29T14:12:01.309Z")
      }
    }

Person Model

protected $dates = ['dateOfBirth'];

How can I add the date fields in nested objects to this array?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire