Appearance
EventSubEventFactory
php
final class Zairakai\LaravelTwitch\Dto\EventSub\EventSubEventFactoryResolves a raw EventSub notification into its typed DTO.
Covers the full EventSub subscription type catalog (77 types, verified against the official example payloads on 2026-08-09, channel.bits.use added 2026-08-13 - drop.entitlement.grant deliberately left out: it is organization/campaign-scoped, not broadcaster-scoped, and its exact payload shape is not fully published in the official docs). Any future type Twitch adds before this factory is updated still falls back to GenericEventSubEvent - no notification is ever silently dropped or left untyped at the object level.
Source: src/Dto/EventSub/EventSubEventFactory.php
Methods
make()
php
public static function make(string $type, array $payload): EventSubEvent| Parameter | Description |
|---|---|
$type | Subscription type as sent by Twitch (e.g. channel.follow) |
$payload | Raw event object from the notification |