how to expose grouped entity data

I want to achieve a GET request response like this, I can create the object in the service layer, the question is how can I expose this in the resource yet the resource assumes its supported class structure


"results": [

	attended: [ ],

	hasNotReturned: [ ],

	scheduled: [ ]



@dkayiwa @darius @tendomart

1 Like

Hello I would appreciate your response on the above

Is your module on github for us to take a look?

It’s the appointments scheduling module, while returning dairyAppointments, I would like to group them as above where each group would be containing a list of appointments

Is this possible?

What do you use to group the appointments?

no idea yet, i’m open to suggestions