@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | public function handle() |
33 | 33 | { |
34 | 34 | |
35 | - if($this->option("generate")) { |
|
35 | + if ($this->option("generate")) { |
|
36 | 36 | $this->info("== Generating Seeder =="); |
37 | 37 | $this->generateSeeder(); |
38 | 38 | $this->info("== Finish =="); |
39 | - }else{ |
|
39 | + } else { |
|
40 | 40 | $this->info("== Importing the seeder =="); |
41 | - $this->call("db:seed",["--class"=>"CbMigrationSeeder"]); |
|
41 | + $this->call("db:seed", ["--class"=>"CbMigrationSeeder"]); |
|
42 | 42 | $this->info("== Finish =="); |
43 | 43 | } |
44 | 44 | |
@@ -50,18 +50,18 @@ discard block |
||
50 | 50 | $php_string = ""; |
51 | 51 | $additional_tables = cbConfig("ADDITIONAL_DATA_MIGRATION"); |
52 | 52 | |
53 | - foreach($tables as $table) { |
|
54 | - if(substr($table,0,3) == "cb_" || in_array($table, $additional_tables)) { |
|
53 | + foreach ($tables as $table) { |
|
54 | + if (substr($table, 0, 3) == "cb_" || in_array($table, $additional_tables)) { |
|
55 | 55 | $this->info("Create seeder for table : ".$table); |
56 | 56 | $rows = DB::table($table)->get(); |
57 | 57 | $data = []; |
58 | - foreach($rows as $i=>$row) { |
|
58 | + foreach ($rows as $i=>$row) { |
|
59 | 59 | $data[$i] = []; |
60 | - foreach($row as $key=>$val) { |
|
60 | + foreach ($row as $key=>$val) { |
|
61 | 61 | $data[$i][$key] = $val; |
62 | 62 | } |
63 | 63 | } |
64 | - if(count($data)!=0) { |
|
64 | + if (count($data) != 0) { |
|
65 | 65 | $php_string .= 'DB::table(\''.$table.'\')->delete();'."\n\t\t\t"; |
66 | 66 | $php_string .= 'DB::table(\''.$table.'\')->insert('.min_var_export($data).');'."\n\t\t\t"; |
67 | 67 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $composer_path = ''; |
92 | 92 | if (file_exists(getcwd().'/composer.phar')) { |
93 | 93 | $composer_path = '"'.PHP_BINARY.'" '.getcwd().'/composer.phar'; |
94 | - }else{ |
|
94 | + } else { |
|
95 | 95 | $composer_path = 'composer'; |
96 | 96 | } |
97 | 97 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $this->info("== Generating Seeder =="); |
37 | 37 | $this->generateSeeder(); |
38 | 38 | $this->info("== Finish =="); |
39 | - }else{ |
|
39 | + } else{ |
|
40 | 40 | $this->info("== Importing the seeder =="); |
41 | 41 | $this->call("db:seed",["--class"=>"CbMigrationSeeder"]); |
42 | 42 | $this->info("== Finish =="); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $composer_path = ''; |
92 | 92 | if (file_exists(getcwd().'/composer.phar')) { |
93 | 93 | $composer_path = '"'.PHP_BINARY.'" '.getcwd().'/composer.phar'; |
94 | - }else{ |
|
94 | + } else{ |
|
95 | 95 | $composer_path = 'composer'; |
96 | 96 | } |
97 | 97 |