fix areageoseeder to use env
This commit is contained in:
parent
ece101b6d2
commit
5bfd71e7d7
@ -10,9 +10,15 @@ class AreaGeoSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* API configuration for fetching zones data
|
* 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;
|
||||||
//protected string $apiUrl = 'http://services-summit.my.id/api/zones'; //PROD
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->apiUrl = env('AREAGEO_API_URL', 'http://services-summit.my.id/api/zones');
|
||||||
|
}
|
||||||
|
|
||||||
// public function run()
|
// public function run()
|
||||||
// {
|
// {
|
||||||
@ -63,6 +69,7 @@ class AreaGeoSeeder extends Seeder
|
|||||||
$client = Services::curlrequest([
|
$client = Services::curlrequest([
|
||||||
'baseURI' => $this->apiUrl,
|
'baseURI' => $this->apiUrl,
|
||||||
'timeout' => 30,
|
'timeout' => 30,
|
||||||
|
'verify' => str_starts_with($this->apiUrl, 'https://'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$response = $client->get('');
|
$response = $client->get('');
|
||||||
|
|||||||
3
env
3
env
@ -67,3 +67,6 @@
|
|||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
# logger.threshold = 4
|
# 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
|
||||||
Loading…
x
Reference in New Issue
Block a user