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?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3euoGgS
via IFTTT

Aucun commentaire:

Enregistrer un commentaire