Laravel, ENV Variable from routes file
<p>I try to access ENV variable from routes/web.php file, but it keep failing. The reason is I want to make special routes group for dashboard / client area. Here is my latest code;</p>

<pre><code>$dashboard = env('DASHBOARD_DOMAIN', 'localhost');

Route::group(['domain' =&gt; 'dashboard.localhost.dev','middleware' =&gt; 'auth'], function () {
    Route::get('/', 'DashboardController@index');
});
</code></pre>

<p>Above code is work, but I don't want to hard code the domain value like that, because if I use this way I need to change them again everytime I upload my code to production server. But if I put $dashboard as domain value, it simply not work.</p>