I am giving this error Call to undefined function getDefaultConfigByHost() In constants.php line 5:
In helper.php
function getDefaultConfigByHost($developmentValue = null, $testValue = null,
$productionValue = null)
{
try {
if (! isset($_SERVER['HTTP_HOST'])) {
return null;
}
$domain = $_SERVER['HTTP_HOST'];
switch ($domain) {
case 'xxx.gglemd.com':
return $developmentValue;
case '192.168.1.18:8001':
return $testValue;
case 'yyy.service.com':
return $productionValue;
default:
return '';
}
} catch (Exception $exception) {
return '';
}
}
In constants.php
<?php
return [
'api' => [
'base' => env('API_BASE', getDefaultConfigByHost(),
'sfile_base' => env('SXFILE_API_BASE', getDefaultConfigByHost('')),
'private_key' => env('API_REQUEST_PRIVATE_KEY', 'bn-sjaddasdsadsadasdas'),
],
];