Hi,
- Yes.
- The second argument is only use if you don't set the environment variable.
- You need to set this environment variable on your
.envfile.
I Have watched Jeffrey's lesson on this as well as read the L5 docs and read Matt Stauffers guide on upgrading and still. I have a general idea how .env works but the specifics are not clear to me:
In my .env file I set up 1 and only 1 environment eg "local" or "production" - correct?
In config/database.php I the second value in the below array is "forge" - but I am not using forge, so what kind of fall back would I put in there ?
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
Now, you can edit your APP_ENV--which, as you can tell from the default, is the primary way for us to set the application environment name. Check out the newer, simpler environment detection in bootstrap/environment.php:
Where do I find " APP_ENV" ? Also, there is no file bootstrap/environment.php.
Then he goes on to reference:
$env = $app->detectEnvironment(function()
{
return getenv('APP_ENV') ?: 'production';
});
Sorry if these are dumb questions, but I have tried to find the answers for myself, without much luck.
Many thanks !!
Please or to participate in this conversation.