Best way to access PHP super-global variables in Laravel 5.x config file
<p>I need to use one parameter from global variable <code>$_SERVER</code> in my config file (app.php), so that I can access <code>SERVER_NAME</code> and define which static resource server to use.</p>

<pre><code>$staticUrlMap['local.example.com'] = 'localstatic.example.com';
$staticUrlMap['dev.example.com'] = 'devstatic.example.com';
$staticUrlMap['stage.example.com'] = 'stagestatic.example.com';
$staticUrlMap['preprod.example.com'] = 'preprodstatic.example.com';
$staticUrlMap['my.example.com'] = 'static.example.com';

$staticUrl = '';
if(!empty($_SERVER['SERVER_NAME']))
{
    $staticUrl = $staticUrlMap[$_SERVER['SERVER_NAME']];
}

return [
    'static_url' =&gt; $staticUrl,
];
</code></pre>

<p>Is there a better way to achieve this other than using <code>$_SERVER</code> directly in laravel-config file?</p>