skmetaly/laravel-twitch-restful-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

skmetaly/laravel-twitch-restful-api

Composer 安装命令:

composer require skmetaly/laravel-twitch-restful-api

包简介

Laravel twitch api

README 文档

README

Laravel Twittch restful api. An implementation of the twitch restful api V3 provided by Twitch.tv Documentation of the API can be found at Twitch restful api link

Installation

Require the package in composer.json :

"skmetaly/laravel-twitch-restful-api": "dev-master"

In config/app.php add providers

'Skmetaly\TwitchApi\Providers\TwitchApiServiceProvider'

In aliases

'TwitchApi'=>'Skmetaly\TwitchApi\Facades\TwitchApiServiceFacade'

Publish the config

php artisan vendor:publish --force

Create a twitch application ( in your twitch settings page, Connections tab ) Create a client secret Add both client secret, client id to the twitch-api.php config

Change the scopes that the application needs to better suit your needs

Usage

The api provides both non-authenticated and authenticated requests

Authentication

Twitch api uses OAuth 2.0 protocol for authentication.

This API uses the Authorization Code Flow.

First step for authenticating a user is to send him to the twitch authentication URL

   public function authenticate()
   {
       return Redirect::to(TwitchApi::authenticationURL());
   }

Keep in mind that the api uses the config set in twitch-api.redirect_url for redirecting after authentication

After the user accepted the scopes and authorised your app, it will be redirected at the value set in config('twitch-api.redirect_url')

A sample of handling the redirect :

   public function redirect()
   {
       $code = Input::get('code');

       $token = TwitchApi::requestToken($code);
   }

You need to persist both the username and token associated with it to use all of the authenticated requests

统计信息

  • 总下载量: 378
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 3
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固