NOTICE: This library uses the latest Twitch HELIX API which ist not fully featured yet
Minimum Requirements: php 7.1
composer require sevenpluss/twitch-api
Or add sevenpluss/twitch-api
to your composer.json
"sevenpluss/twitch-api": "^1.0"
Run composer update
to pull the latest version.
<?php
namespace YourApp\Http\Controllers;
use Sevenpluss\TwitchApi\Services\TwitchApi;
use Sevenpluss\TwitchApi\Services\ClientSettings;
class VideoController
{
protected $api;
public function __construct()
{
// make a self extended ClientSettings class with custom settings
$settings = new ClientSettings('client_id', 'client_secret', 'redirect_url');
$this->api = new TwitchApi($settings);
}
public function index()
{
$videos = $this->api->videos()->getVideosByUserId('31239503')->data();
return compact('videos');
}
}
Twitch Helix API Documentation: https://dev.twitch.tv/docs/api/reference
The everyone response from Twitch Server encapsulated at Services/Result
object.