You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to map an incoming webhook to a DTO, so that I can use that DTO for some processing throughout the application. Perhaps I'm missing something, but what is the best way to go about this? My constructor will become extremely large as the webhook has 20+ fields, some of which are nested.
class IncomingWebhook extends Data
{
public function __construct(
public string $title,
public string $topic,
public string $app_id,
public string $type,
//etc
) {
//Silence
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to map an incoming webhook to a DTO, so that I can use that DTO for some processing throughout the application. Perhaps I'm missing something, but what is the best way to go about this? My constructor will become extremely large as the webhook has 20+ fields, some of which are nested.
Beta Was this translation helpful? Give feedback.
All reactions