Skip to content

HasUserMethods ​

php
trait Zairakai\LaravelTwitch\Services\Concerns\HasUserMethods

Twitch User API methods.

Source: src/Services/Concerns/HasUserMethods.php

Methods ​

blockUser() ​

php
public function blockUser(string $targetUserId, string $reason = null): void

Block a specific user from interacting with the authenticated user.

ParameterDescription
$reasonharassment, spam, or other

checkUserSubscription() ​

php
public function checkUserSubscription(string $broadcasterId, string $userId): SubscriptionCheck

Check whether a user subscribes to a broadcaster's channel.

getAuthenticatedUser() ​

php
public function getAuthenticatedUser(): User

Get the currently authenticated user.

getAuthorizationByUser() ​

php
public function getAuthorizationByUser(string|array $userIds): DataCollection

Get the authorization scopes that the specified user(s) have granted this application.

ParameterDescription
$userIdsOne or more user IDs to check (max 10)

Returns DataCollection<int, UserAuthorization>

getChannelFollowers() ​

php
public function getChannelFollowers(string $broadcasterId, string $userId = null, int $first = 20, string $after = null): PaginatedResult

Get the list of users who follow the specified broadcaster.

Returns PaginatedResult<Follower>

getFollowedChannels() ​

php
public function getFollowedChannels(string $userId, string $broadcasterId = null, int $first = 20, string $after = null): PaginatedResult

Get the channels that the authenticated user follows.

Returns PaginatedResult<FollowedChannel>

getSubscriptions() ​

php
public function getSubscriptions(string $broadcasterId, string $userId = null, int $first = 20, string $after = null): PaginatedResult

Get the list of channels that the specified broadcaster's users subscribe to.

Returns PaginatedResult<Subscription>

getUserActiveExtensions() ​

php
public function getUserActiveExtensions(string $userId = null): array

Get the active extensions used by a specified user.

Returns array<string, mixed>

getUserBlocks() ​

php
public function getUserBlocks(string $broadcasterId, int $first = 20, string $after = null): PaginatedResult

Get the list of users that the authenticated user has blocked.

Returns PaginatedResult<BlockedUser>

getUserExtensions() ​

php
public function getUserExtensions(): array

Get the list of all extensions (active and inactive) installed by the authenticated broadcaster. Unlike getUserActiveExtensions(), this always identifies the broadcaster from the access token - Twitch's API takes no user_id parameter here.

Returns array<string, mixed>

getUsers() ​

php
public function getUsers(string|array|null $ids = null, string|array|null $logins = null): DataCollection

Get information about one or more users by ID or login.

ParameterDescription
$idsUser ID(s)
$loginsUser login(s)

Returns DataCollection<int, User>

unblockUser() ​

php
public function unblockUser(string $targetUserId): void

Remove the block that the authenticated user has placed on a target user.

updateUser() ​

php
public function updateUser(string $description = null): User

Update the authenticated user's description.

updateUserExtensions() ​

php
public function updateUserExtensions(array $data): array

Update the active extensions installed for a user.

ParameterDescription
$dataExtensions data with panel, overlay, component keys

Returns array<string, mixed>

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