@@ -92,13 +92,13 @@ discard block |
||
| 92 | 92 | $environments = $this->parse($environment); |
| 93 | 93 | foreach ($environments as $env) { |
| 94 | 94 | $results = $this->queryBuilder |
| 95 | - ->from($this->table) |
|
| 96 | - ->where('env')->is($env) |
|
| 97 | - ->where('module')->is($group) |
|
| 98 | - ->where('status')->is(1) |
|
| 99 | - ->select() |
|
| 100 | - ->fetchObject() |
|
| 101 | - ->all(); |
|
| 95 | + ->from($this->table) |
|
| 96 | + ->where('env')->is($env) |
|
| 97 | + ->where('module')->is($group) |
|
| 98 | + ->where('status')->is(1) |
|
| 99 | + ->select() |
|
| 100 | + ->fetchObject() |
|
| 101 | + ->all(); |
|
| 102 | 102 | |
| 103 | 103 | if ($results) { |
| 104 | 104 | $config = []; |
@@ -153,13 +153,13 @@ discard block |
||
| 153 | 153 | foreach ($results as $cfg) { |
| 154 | 154 | if ($cfg->parent) { |
| 155 | 155 | $results = $this->queryBuilder |
| 156 | - ->from($this->table) |
|
| 157 | - ->where('env')->is($cfg->env) |
|
| 158 | - ->where('module')->is($cfg->parent) |
|
| 159 | - ->where('status')->is(1) |
|
| 160 | - ->select() |
|
| 161 | - ->fetchObject() |
|
| 162 | - ->all(); |
|
| 156 | + ->from($this->table) |
|
| 157 | + ->where('env')->is($cfg->env) |
|
| 158 | + ->where('module')->is($cfg->parent) |
|
| 159 | + ->where('status')->is(1) |
|
| 160 | + ->select() |
|
| 161 | + ->fetchObject() |
|
| 162 | + ->all(); |
|
| 163 | 163 | |
| 164 | 164 | foreach ($results as $cfg) { |
| 165 | 165 | $config[$cfg->name] = $cfg->value ?? $cfg->default_value; |
@@ -9,44 +9,44 @@ |
||
| 9 | 9 | |
| 10 | 10 | public function up(): void |
| 11 | 11 | { |
| 12 | - //Action when migrate up |
|
| 13 | - $this->create('config', function (CreateTable $table) { |
|
| 14 | - $table->integer('id') |
|
| 15 | - ->autoincrement() |
|
| 16 | - ->primary(); |
|
| 17 | - $table->string('env') |
|
| 18 | - ->description('The config environment') |
|
| 19 | - ->index(); |
|
| 20 | - $table->string('module') |
|
| 21 | - ->description('The module') |
|
| 22 | - ->index(); |
|
| 23 | - $table->string('code') |
|
| 24 | - ->description('The config code') |
|
| 25 | - ->notNull() |
|
| 26 | - ->index(); |
|
| 27 | - $table->string('value') |
|
| 28 | - ->description('The config value'); |
|
| 29 | - $table->string('type') |
|
| 30 | - ->description('The config data type'); |
|
| 31 | - $table->text('comment') |
|
| 32 | - ->description('The config description'); |
|
| 33 | - $table->integer('status') |
|
| 34 | - ->description('The config status') |
|
| 35 | - ->defaultValue(0) |
|
| 36 | - ->notNull(); |
|
| 37 | - $table->datetime('created_at') |
|
| 38 | - ->description('role created at') |
|
| 39 | - ->notNull(); |
|
| 40 | - $table->datetime('updated_at') |
|
| 41 | - ->description('role updated at'); |
|
| 12 | + //Action when migrate up |
|
| 13 | + $this->create('config', function (CreateTable $table) { |
|
| 14 | + $table->integer('id') |
|
| 15 | + ->autoincrement() |
|
| 16 | + ->primary(); |
|
| 17 | + $table->string('env') |
|
| 18 | + ->description('The config environment') |
|
| 19 | + ->index(); |
|
| 20 | + $table->string('module') |
|
| 21 | + ->description('The module') |
|
| 22 | + ->index(); |
|
| 23 | + $table->string('code') |
|
| 24 | + ->description('The config code') |
|
| 25 | + ->notNull() |
|
| 26 | + ->index(); |
|
| 27 | + $table->string('value') |
|
| 28 | + ->description('The config value'); |
|
| 29 | + $table->string('type') |
|
| 30 | + ->description('The config data type'); |
|
| 31 | + $table->text('comment') |
|
| 32 | + ->description('The config description'); |
|
| 33 | + $table->integer('status') |
|
| 34 | + ->description('The config status') |
|
| 35 | + ->defaultValue(0) |
|
| 36 | + ->notNull(); |
|
| 37 | + $table->datetime('created_at') |
|
| 38 | + ->description('role created at') |
|
| 39 | + ->notNull(); |
|
| 40 | + $table->datetime('updated_at') |
|
| 41 | + ->description('role updated at'); |
|
| 42 | 42 | |
| 43 | - $table->engine('INNODB'); |
|
| 44 | - }); |
|
| 43 | + $table->engine('INNODB'); |
|
| 44 | + }); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function down(): void |
| 48 | 48 | { |
| 49 | - //Action when migrate down |
|
| 50 | - $this->drop('config'); |
|
| 49 | + //Action when migrate down |
|
| 50 | + $this->drop('config'); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | \ No newline at end of file |