]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/TwitchToken.php
endpoint for twitch leaderboard
[alttp.git] / app / Models / TwitchToken.php
index 9b15977b41e881afae2cf5c367c09ed553156cee..a4c561eaffa40ce75cc49f5272cf13c8a1fb5b87 100644 (file)
@@ -35,6 +35,14 @@ class TwitchToken extends Model
                $this->save();
        }
 
+       public function request() {
+               return Http::baseUrl('https://api.twitch.tv/helix')
+                       ->withToken($this->access)
+                       ->withHeaders([
+                               'Client-Id' => config('twitch.client_id'),
+                       ]);
+       }
+
        protected $casts = [
                'scope' => 'array',
        ];