Skip to content

HasEventSubMethods ​

php
trait Zairakai\LaravelTwitch\Services\Concerns\HasEventSubMethods

Twitch 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'): Subscription

Create an EventSub subscription using webhook transport.

ParameterDescription
$conditionSubscription-specific condition (e.g. broadcaster_user_id)
$callbackUrlPublic HTTPS URL to receive events
$secretSecret for HMAC verification (10-100 chars)
$versionSubscription type version (default '1')

createEventSubWebSocketSubscription() ​

php
public function createEventSubWebSocketSubscription(string $type, array $condition, string $sessionId, string $version = '1'): Subscription

Create an EventSub subscription using WebSocket transport.

ParameterDescription
$conditionSubscription-specific condition
$sessionIdWebSocket session ID from the welcome message
$versionSubscription type version (default '1')

deleteEventSubSubscription() ​

php
public function deleteEventSubSubscription(string $subscriptionId): void

Delete an EventSub subscription.

deleteEventSubSubscriptionsByType() ​

php
public function deleteEventSubSubscriptionsByType(string $type): int

Delete 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): PaginatedResult

Get a list of EventSub subscriptions.

ParameterDescription
$typeFilter 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.
$statusFilter 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): PaginatedResult

Get all active EventSub subscriptions of a given type.

Returns PaginatedResult<Subscription>

Documentation of 4.1.4 , built from a03e949 on 4.1.4 by pipeline #2949087255 on 2026-10-11.