Skip to content

Commit 49c01ee

Browse files
committed
get odds for events and get scores for sport
1 parent 7d633fe commit 49c01ee

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Traits/Endpoints/UseOdds.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,11 @@ public function getOddsForSport(SportsEnum $sport, $params = [])
1515

1616
return $this->decodeResponse($this->get("/sports/$sport->value/odds", $params));
1717
}
18+
19+
public function getOddsForEvent(SportsEnum $sport, string $event, $params)
20+
{
21+
$this->validateParams($params, requiredParams: ['regions']);
22+
23+
return $this->decodeResponse($this->get("/sports/{$sport}/events/{$event}/odds"));
24+
}
1825
}

src/Traits/Endpoints/UseSports.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace SethSharp\OddsApi\Traits\Endpoints;
44

5+
use SethSharp\OddsApi\Enums\SportsEnum;
56
use SethSharp\OddsApi\Traits\UseValidatesParams;
67

78
trait UseSports
@@ -14,4 +15,9 @@ public function getSports($params = [])
1415

1516
return $this->decodeResponse($this->get('/sports', $params));
1617
}
18+
19+
public function getScoresForSport(SportsEnum $sport)
20+
{
21+
return $this->decodeResponse($this->get("/sports/{$sport}/scores"));
22+
}
1723
}

0 commit comments

Comments
 (0)