From 349114c9608e8fbe91693470b60bdbe0f27a1584 Mon Sep 17 00:00:00 2001 From: PiggyPiglet Date: Fri, 26 Jul 2019 23:05:57 +0800 Subject: [PATCH] Add a --settings-ui option for AppSettingsCommand (#1446) * Add a --settings-ui option for AppSettingsCommand Sorry if my code is below par, I don't know php. All this does is allow the APP_ENVIRONMENT_ONLY to be set via an option, which as far as I can tell, isn't currently possible. I've tested this on a local installation and it works. --- app/Console/Commands/Environment/AppSettingsCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/Environment/AppSettingsCommand.php b/app/Console/Commands/Environment/AppSettingsCommand.php index 9a10bfd0d..038e206f6 100644 --- a/app/Console/Commands/Environment/AppSettingsCommand.php +++ b/app/Console/Commands/Environment/AppSettingsCommand.php @@ -68,7 +68,7 @@ class AppSettingsCommand extends Command {--redis-host= : Redis host to use for connections.} {--redis-pass= : Password used to connect to redis.} {--redis-port= : Port to connect to redis over.} - {--disable-settings-ui}'; + {--settings-ui= : Enable or disable the settings UI.}'; /** * @var array @@ -138,8 +138,8 @@ class AppSettingsCommand extends Command array_key_exists($selected, self::ALLOWED_QUEUE_DRIVERS) ? $selected : null ); - if ($this->option('disable-settings-ui')) { - $this->variables['APP_ENVIRONMENT_ONLY'] = 'true'; + if (! is_null($this->option('settings-ui'))) { + $this->variables['APP_ENVIRONMENT_ONLY'] = $this->option('settings-ui') == 'true' ? 'false' : 'true'; } else { $this->variables['APP_ENVIRONMENT_ONLY'] = $this->confirm(trans('command/messages.environment.app.settings'), true) ? 'false' : 'true'; }