Appearance
HasEventSubMethods
php
trait Zairakai\LaravelTwitch\Services\Concerns\HasEventSubMethodsTwitch EventSub management methods.
Source: src/Services/Concerns/HasEventSubMethods.php
Methods
createEventSubSubscription()
php
public function createEventSubSubscription(string $type, array $condition, string $callbackUrl, string $secret, string $version = '1'): SubscriptionCreate an EventSub subscription using webhook transport.
| Parameter | Description |
|---|---|
$condition | Subscription-specific condition (e.g. broadcaster_user_id) |
$callbackUrl | Public HTTPS URL to receive events |
$secret | Secret for HMAC verification (10-100 chars) |
$version | Subscription type version (default '1') |
createEventSubWebSocketSubscription()
php
public function createEventSubWebSocketSubscription(string $type, array $condition, string $sessionId, string $version = '1'): SubscriptionCreate an EventSub subscription using WebSocket transport.
| Parameter | Description |
|---|---|
$condition | Subscription-specific condition |
$sessionId | WebSocket session ID from the welcome message |
$version | Subscription type version (default '1') |
deleteEventSubSubscription()
php
public function deleteEventSubSubscription(string $subscriptionId): voidDelete an EventSub subscription.
deleteEventSubSubscriptionsByType()
php
public function deleteEventSubSubscriptionsByType(string $type): intDelete all EventSub subscriptions that match a given type.
Returns int Number of deleted subscriptions
getEventSubSubscriptions()
php
public function getEventSubSubscriptions(string $type = null, string $status = null, int $first = 100, string $after = null): PaginatedResultGet a list of EventSub subscriptions.
| Parameter | Description |
|---|---|
$type | Filter by subscription type. Mutually exclusive with $status - Twitch's API rejects a request specifying both with a 400 "cannot specify more than one filter" (confirmed live against the real API, not documented explicitly). Passing both here is the caller's responsibility to avoid; see getEventSubSubscriptionsByType() for the type+status use case. |
$status | Filter by subscription type. Mutually exclusive with $status - Twitch's API rejects a request specifying both with a 400 "cannot specify more than one filter" (confirmed live against the real API, not documented explicitly). Passing both here is the caller's responsibility to avoid; see getEventSubSubscriptionsByType() for the type+status use case. |
Returns PaginatedResult<Subscription>
getEventSubSubscriptionsByType()
php
public function getEventSubSubscriptionsByType(string $type): PaginatedResultGet all active EventSub subscriptions of a given type.
Returns PaginatedResult<Subscription>