Appearance
HasUserMethods
php
trait Zairakai\LaravelTwitch\Services\Concerns\HasUserMethodsTwitch User API methods.
Source: src/Services/Concerns/HasUserMethods.php
Methods
blockUser()
php
public function blockUser(string $targetUserId, string $reason = null): voidBlock a specific user from interacting with the authenticated user.
| Parameter | Description |
|---|---|
$reason | harassment, spam, or other |
checkUserSubscription()
php
public function checkUserSubscription(string $broadcasterId, string $userId): SubscriptionCheckCheck whether a user subscribes to a broadcaster's channel.
getAuthenticatedUser()
php
public function getAuthenticatedUser(): UserGet the currently authenticated user.
getAuthorizationByUser()
php
public function getAuthorizationByUser(string|array $userIds): DataCollectionGet the authorization scopes that the specified user(s) have granted this application.
| Parameter | Description |
|---|---|
$userIds | One 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): PaginatedResultGet 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): PaginatedResultGet 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): PaginatedResultGet the list of channels that the specified broadcaster's users subscribe to.
Returns PaginatedResult<Subscription>
getUserActiveExtensions()
php
public function getUserActiveExtensions(string $userId = null): arrayGet 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): PaginatedResultGet the list of users that the authenticated user has blocked.
Returns PaginatedResult<BlockedUser>
getUserExtensions()
php
public function getUserExtensions(): arrayGet 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): DataCollectionGet information about one or more users by ID or login.
| Parameter | Description |
|---|---|
$ids | User ID(s) |
$logins | User login(s) |
Returns DataCollection<int, User>
unblockUser()
php
public function unblockUser(string $targetUserId): voidRemove the block that the authenticated user has placed on a target user.
updateUser()
php
public function updateUser(string $description = null): UserUpdate the authenticated user's description.
updateUserExtensions()
php
public function updateUserExtensions(array $data): arrayUpdate the active extensions installed for a user.
| Parameter | Description |
|---|---|
$data | Extensions data with panel, overlay, component keys |
Returns array<string, mixed>