Ken 1 ay önce
ebeveyn
işleme
f26abf416a
1 değiştirilmiş dosya ile 10 ekleme ve 5 silme
  1. 10 5
      app/Services/ApiFootball/Client.php

+ 10 - 5
app/Services/ApiFootball/Client.php

@@ -8,14 +8,14 @@
 class Client
 {
 
-    // 
+    //
     public static function get($endpoint, $params = [])
     {
         $response = Http::withHeaders([
             'x-apisports-key' => config('services.api_football.key'),
         ])
-        ->withoutVerifying()  // 临时跳过 SSL 验证
-        ->get(config('services.api_football.host') .'/'. $endpoint, $params);
+            ->withoutVerifying()  // 临时跳过 SSL 验证
+            ->get(config('services.api_football.host') . '/' . $endpoint, $params);
 
         if ($response->successful()) {
             return $response->json();
@@ -29,7 +29,7 @@ public static function post($endpoint, $data = [])
     {
         $response = Http::withHeaders([
             'x-apisports-key' => config('services.api_football.key'),
-        ])->post(config('services.api_football.host') .'/'. $endpoint, $data);
+        ])->post(config('services.api_football.host') . '/' . $endpoint, $data);
 
         if ($response->successful()) {
             return $response->json();
@@ -51,9 +51,14 @@ public static function countries($params = [])
         return self::get('countries', $params);
     }
 
+    public static function leagues($params = [])
+    {
+        return static::get('leagues', $params);
+    }
+
     // 赛程
     public static function fixtures($params = [])
     {
         return self::get('fixtures', $params);
     }
-}
+}