@@ -19,20 +19,20 @@ |
||
19 | 19 | ], 'variables-config'); |
20 | 20 | |
21 | 21 | if (! class_exists('CreateVariablesTable')) { |
22 | - $timestamp = date('Y_m_d_His', time()); |
|
22 | + $timestamp = date('Y_m_d_His', time()); |
|
23 | 23 | |
24 | - $this->publishes([ |
|
25 | - __DIR__.'/../database/migrations/create_variables_table.php.stub' => $this->app->databasePath()."/migrations/{$timestamp}_create_variables_table.php", |
|
26 | - ], 'variables-migrations'); |
|
24 | + $this->publishes([ |
|
25 | + __DIR__.'/../database/migrations/create_variables_table.php.stub' => $this->app->databasePath()."/migrations/{$timestamp}_create_variables_table.php", |
|
26 | + ], 'variables-migrations'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | $this->replaceConfigsWithVariables(); |
30 | 30 | |
31 | 31 | if ($this->app->runningInConsole()) { |
32 | - $this->commands([ |
|
33 | - Commands\AllVariable::class, |
|
34 | - Commands\GetVariable::class, |
|
35 | - ]); |
|
32 | + $this->commands([ |
|
33 | + Commands\AllVariable::class, |
|
34 | + Commands\GetVariable::class, |
|
35 | + ]); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 |
@@ -55,17 +55,17 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | if ($collection = $this->getCollection()) { |
58 | - if ($var = $collection |
|
59 | - ->where('key', $key) |
|
60 | - ->whereIn('locale', [$this->locale, null]) |
|
61 | - //->orWhere('locale', null) |
|
62 | - ->first()) { |
|
63 | - |
|
64 | - return $var->value; |
|
65 | - } |
|
66 | - } |
|
58 | + if ($var = $collection |
|
59 | + ->where('key', $key) |
|
60 | + ->whereIn('locale', [$this->locale, null]) |
|
61 | + //->orWhere('locale', null) |
|
62 | + ->first()) { |
|
63 | + |
|
64 | + return $var->value; |
|
65 | + } |
|
66 | + } |
|
67 | 67 | |
68 | - return $default; |
|
68 | + return $default; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function set(string $key, $value = null, $locale = null) |