Updates `$app->detectEnvironment()`

This allows the `cli`, namely `php artisan env`, to return the same `env` as
`nginx`.