Download the PHP package romanzipp/laravel-twitch without Composer

On this page you can find all versions of the php package romanzipp/laravel-twitch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-twitch

Laravel Twitch

Latest Stable Version Total Downloads License GitHub Build Status

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

  1. Installation
  2. Configuration
  3. Examples
  4. Documentation
  5. Upgrading
  6. Development

Installation

Configuration

Copy configuration to project:

Add environmental variables to your .env:

If you want to use the EventSub with the Webhook transport, then you are required to define a secret. This secret is a string between 10 and 100 characters.

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, /followsor /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:

Defining EventSub Handlers

By default, the EventSub webhook controller will automatically handle all EventSub notification and revocation calls; however, if you have additional webhook events you would like to handle, you may do so by extending the EventSub webhook controller.

To ensure your application can handle EventSub webhooks, be sure to configure the webhook callback url in the transport payload.

Your controller's method names should correspond to Laravel Twitch's controller conventions. Specifically, methods should be prefixed with handle, suffixed with Notification and the "camel case" name of the EventSub Type you wish to handle. For example, if you wish to handle the channel.follow type, you should add a handleChannelFollowNotification method to the controller:

Next, define a route to your EventSub webhook controller within your application's routes/api.php file.

Create EventSub Subscription

Important: When creating a subscription, you must specify a secret for purposes of verification, described above in “Configuration”. This secret is automatically attached to the webhook transport if it is not explicitly defined.

List EventSub Subscription

Delete EventSub Subscription

Twitch Extension Guard

1. Create TwitchUserProvider

Create app/Auth/TwitchUserProvider.php:

2. Register TwitchUserProvider & TwitchExtensionGuard

Edit app/Providers/AuthServiceProvider.php:

3. Make guard available in Laravel

Edit config/auth.php:

Documentation

Twitch Helix API Documentation: https://dev.twitch.tv/docs/api/reference

Ads

Analytics

Bits

ChannelPoints

Channels

Charity

Chat

Clips

Entitlements

EventSub

Extensions

Games

Goals

HypeTrain

Moderation

Music

OAuth

Polls

Predictions

Raids

Schedule

Search

Streams

Subscriptions

Tags

Teams

Users

Videos

Webhooks

Whispers

OAuth Scopes Enums

Upgrading

Development

Run Tests

Generate Documentation


Join the Twitch Dev Discord!

Discord

Discord


All versions of laravel-twitch with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
ext-json Version *
firebase/php-jwt Version ^6.2
guzzlehttp/guzzle Version ^7.0
illuminate/cache Version ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/console Version ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package romanzipp/laravel-twitch contains the following files

Loading the files please wait ....