How to change the app environment at run time?
PHP Snippet 1:
dump(config('app.env')); // "testing"
config(['app.env' => 'production']);
dump(config('app.env')); // "production"
PHP Snippet 2:
dump(app()->environment()); // "testing"
app()['env'] = 'production';
dump(app()->environment()); // "production"
PHP Snippet 3:
$this->app['env'] = 'production';