Laravel Twitch
A Laravel package to use the Twitch v5 API, (*1)
, (*2)
Simple package for interacting with the Twitch v5 API, (*3)
Installation
You can install the package via composer:, (*4)
``` bash
composer require kallencode/laravel-twitch, (*5)
Install the ServiceProvider.
```php
// config/app.php
'providers' => [
...
Kallencode\Twitch\TwitchServiceProvider::class,
...
];
This package also comes with a facade:, (*6)
// config/app.php
'aliases' => [
...
'Twitch' => Kallencode\Twitch\TwitchFacade::class,
...
];
You can publish the config file of this package with this command:, (*7)
php artisan vendor:publish --provider="Kallencode\Twitch\TwitchServiceProvider"
The following config file will be published in config/laravel-twitch.php
, (*8)
return [
'clientId' => env('TWITCH_CLIENT_ID'),
'baseUrl' => env('TWITCH_BASE_URL','https://api.twitch.tv/kraken/')
];
Usage
``` php
$channel = Twitch::getChannelById(44322889);, (*9)
## Finding your Client ID
Go to [https://www.twitch.tv/settings/connections](https://www.twitch.tv/settings/connections)
Scroll to the bottom of the page and register your application under Developer Applications.
Copy the Client ID and set the `TWITCH_CLIENT_ID` environment variable.
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Testing
``` bash
$ composer test
Contributing
Please see CONTRIBUTING for details., (*10)
Security
If you discover any security related issues, please email info@kallencode.nl instead of using the issue tracker., (*11)
Credits
About Kallencode
Kallencode, (*12)
License
The MIT License (MIT). Please see License File for more information., (*13)