Skip to content

Instantly share code, notes, and snippets.

@carbontwelve
Created January 28, 2014 10:04
Show Gist options
  • Save carbontwelve/8665022 to your computer and use it in GitHub Desktop.
Save carbontwelve/8665022 to your computer and use it in GitHub Desktop.
<?php
$env = $app->detectEnvironment(
function()
{
if (isset($_SERVER['HTTP_HOST']))
{
switch ( $_SERVER['HTTP_HOST'] )
{
case 'example.local':
$env = 'local';
break;
case 'staging.example.com':
$env = 'staging';
break;
case 'dev.example.com':
$env = 'dev';
break;
default:
$env = 'live';
}
return $env;
}else{
// Artisan Default Environment
return 'local';
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment