Download the PHP package bulgarianhealer/laravel-twitch without Composer
On this page you can find all versions of the php package bulgarianhealer/laravel-twitch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bulgarianhealer/laravel-twitch
More information about bulgarianhealer/laravel-twitch
Files in bulgarianhealer/laravel-twitch
Package laravel-twitch
Short Description Twitch PHP Wrapper for Laravel
License MIT
Informations about the package laravel-twitch
Laravel Twitch
PHP Twitch Helix API Wrapper for Laravel 5+
⚠️ Changes on May 01, 2020
Since May 01, 2020, Twitch requires all requests to contain a valid OAuth Access Token. This can be achieved by requesting an OAuth Token using the Client Credentials Flow.
If you don't handle this by yourself, be sure to enable the built-in Access Token generation feature via the oauth_client_credentials.auto_generate
configuration entry.
You will need define a valid Client ID and Client Secret via your config or the available setters! See the full config for more details.
Table of contents
- Installation
- Configuration
- Examples
- Documentation
- Upgrading
- Development
Installation
If you use Laravel 5.5+ you are already done, otherwise continue.
Add Service Provider to your app.php
configuration file:
Configuration
Copy configuration to config folder:
Add environmental variables to your .env
Examples
Basic
Setters
OAuth Tokens
OAuth Client Credentials Flow
Since May 01, 2020, every request requires an OAuth token which can be issued using the OAuth Client Credentials Flow.
Pagination
The Twitch API returns a paginator
field with paginated results like /streams
, /follows
or /games
. To jump between pages, the given cursor must be appended to the following query using the direction attributes after
or before
.
In this example, we will fetch a set of streams and use the provided cursor to switch to the next/previous set of data.
❗️ To prevent infinite loops or errors, use the Result::hasMoreResults()
method to check if there are more results available.
Facade
Pagination Loop Example
This example fetches all Twitch Games and stores them into a database.
Insert user objects
The new API does not include the user objects in endpoints like followers or bits.
You can just call the insertUsers method to insert all user data identified by from_id
into from_user
New Result data:
Documentation
Twitch Helix API Documentation: https://dev.twitch.tv/docs/api/reference
OAuth
Ads
Analytics
Bits
Clips
Entitlements
Extensions
Games
HypeTrain
Search
Streams
Users
Videos
Subscriptions
Tags
Moderation
Webhooks
Upgrading
Development
Run Tests
Generate Documentation
Join the Twitch Dev Discord!
All versions of laravel-twitch with dependencies
illuminate/support Version ^5.5|^6.0|^7.0|^8.0
illuminate/console Version ^5.5|^6.0|^7.0|^8.0
illuminate/cache Version ^5.5|^6.0|^7.0|^8.0
guzzlehttp/guzzle Version ^6.3|^7.0
ext-json Version *