From c896b3c0b6c9da2bdbb8c1b3738d4357bd87492e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20J=C3=BCrisoo?= Date: Fri, 3 Apr 2020 11:32:10 +0200 Subject: [PATCH] More forgiving ignore option Thanks for this amazing package :rocket: I ran into a problem when I using `--ignore="table1, table2, ...` because of the exploding does not allow whitespace. How about changing that to a more forgiving `preg_split`? Example: ``` $list = "a, b,c d"; preg_split('/[,\s]+/', $list); ``` This might be implemented in other places as well. --- src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php b/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php index 96dc664..bffc48f 100644 --- a/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php +++ b/src/OscarAFDev/MigrationsGenerator/MigrateGenerateCommand.php @@ -396,7 +396,7 @@ protected function getExcludedTables() $excludes = ['migrations']; $ignore = $this->option('ignore'); if ( ! empty($ignore)) { - return array_merge($excludes, explode(',', $ignore)); + return array_merge($excludes, preg_split('/[,\s]+/', ignore)); } return $excludes;