feature(tags): added tags to pois
This commit is contained in:
24
app/Http/Services/CaptianCosterApi.php
Normal file
24
app/Http/Services/CaptianCosterApi.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Services;
|
||||
|
||||
use Illuminate\Http\Client\PendingRequest;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class CaptianCosterApi
|
||||
{
|
||||
private readonly string $uri;
|
||||
private readonly PendingRequest $client;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
if(!($apiKey = env('CAPTAIN_COASTER_API_KEY'))) {
|
||||
throw new \Exception('No API key found for Captain Coaster API');
|
||||
}
|
||||
|
||||
$this->uri = 'https://captaincoaster.com/api/';
|
||||
$this->client = Http::baseUrl($this->uri)->withHeaders([
|
||||
'Authorization' => $apiKey
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ use App\Models\ThemeParkUser;
|
||||
use Illuminate\Http\Client\PendingRequest;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
|
||||
class PhantasialandApi
|
||||
{
|
||||
@@ -33,7 +32,9 @@ class PhantasialandApi
|
||||
// NOTE: we filter everything out that is adminOnly = true
|
||||
$pois = $pois->filter(function ($poi) {
|
||||
return $poi['category'] === 'ATTRACTIONS' && $poi['adminOnly'] === false &&
|
||||
$poi['poiNumber'] !== null;
|
||||
$poi['poiNumber'] !== null &&
|
||||
$poi["parkMonitorReferenceName"] !== null &&
|
||||
in_array('SUMMER', $poi['seasons']);
|
||||
});
|
||||
|
||||
// sort by parkMonitorReferenceName
|
||||
|
||||
Reference in New Issue
Block a user