diff --git a/app/Database/Seeds/AreaGeoSeeder.php b/app/Database/Seeds/AreaGeoSeeder.php index b4c47f1..8fb080e 100644 --- a/app/Database/Seeds/AreaGeoSeeder.php +++ b/app/Database/Seeds/AreaGeoSeeder.php @@ -10,9 +10,15 @@ class AreaGeoSeeder extends Seeder { /** * API configuration for fetching zones data + * Configure in .env: AREAGEO_API_URL=https://services-summit.my.id/api/zones */ - protected string $apiUrl = 'https://services-summit.my.id/api/zones'; //DEV - //protected string $apiUrl = 'http://services-summit.my.id/api/zones'; //PROD + protected string $apiUrl; + + public function __construct() + { + parent::__construct(); + $this->apiUrl = env('AREAGEO_API_URL', 'http://services-summit.my.id/api/zones'); + } // public function run() // { @@ -63,6 +69,7 @@ class AreaGeoSeeder extends Seeder $client = Services::curlrequest([ 'baseURI' => $this->apiUrl, 'timeout' => 30, + 'verify' => str_starts_with($this->apiUrl, 'https://'), ]); $response = $client->get(''); diff --git a/env b/env index f359ec2..7015fcf 100644 --- a/env +++ b/env @@ -67,3 +67,6 @@ #-------------------------------------------------------------------- # logger.threshold = 4 +# Production (HTTP) - or just omit this line to use default +# AREAGEO_API_URL=http://services-summit.my.id/api/zones +# AREAGEO_API_URL=https://services-summit.my.id/api/zones \ No newline at end of file