diff --git a/config/dbsync.php b/config/dbsync.php index 0dccc21..8a9441a 100755 --- a/config/dbsync.php +++ b/config/dbsync.php @@ -73,6 +73,15 @@ 'targetConnection' => env('LOCAL_TARGET_CONNECTION', 'mysql'), 'mysqldumpSkipTzUtc' => env('REMOTE_MYSQLDUMP_SKIP_TZ_UTC', false), + + + /* + * List all the environment variables that need to be set for the command to work + */ + 'environments' => [ + 'local', + 'staging' + ], 'localMysqlPath' => env('LOCAL_MYSQL_PATH', '/usr/local/bin/mysql'), ]; diff --git a/src/Console/DbSyncCommand.php b/src/Console/DbSyncCommand.php index bea591e..5fc831d 100644 --- a/src/Console/DbSyncCommand.php +++ b/src/Console/DbSyncCommand.php @@ -14,7 +14,7 @@ public function handle(): bool { $inTest = $this->option('test'); - if (! in_array(config('app.env'), ['local', 'staging'])) { + if (! in_array(config('app.env'), config('dbsync.environments'))) { $this->error('DB sync will only run on local and staging environments'); return true;