@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function getSettingsValue(): array |
| 35 | 35 | { |
| 36 | 36 | if (config('model_settings.settings_table_use_cache')) { |
| 37 | - return Cache::rememberForever($this->getSettingsCacheKey(), function () { |
|
| 37 | + return Cache::rememberForever($this->getSettingsCacheKey(), function() { |
|
| 38 | 38 | return $this->__getSettingsValue(); |
| 39 | 39 | }); |
| 40 | 40 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | protected static function bootHasSettingsField() |
| 26 | 26 | { |
| 27 | - static::saving(function ($model) { |
|
| 27 | + static::saving(function($model) { |
|
| 28 | 28 | /** @var self $model */ |
| 29 | 29 | $model->fixSettingsValue(); |
| 30 | 30 | }); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | return Cache::remember( |
| 108 | 108 | config('model_settings.settings_table_cache_prefix') . '::has_field', |
| 109 | 109 | now()->addDays(1), |
| 110 | - function () { |
|
| 110 | + function() { |
|
| 111 | 111 | return Schema::connection($this->getConnectionName()) |
| 112 | 112 | ->hasColumn( |
| 113 | 113 | $this->getTable(), |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | public function all(): array |
| 78 | 78 | { |
| 79 | 79 | if (config('model_settings.settings_cache_all') && !($this instanceof RedisSettingsManager)) { |
| 80 | - return Cache::remember($this->getAllSettingsCacheKey(), now()->addDay(), function () { |
|
| 80 | + return Cache::remember($this->getAllSettingsCacheKey(), now()->addDay(), function() { |
|
| 81 | 81 | return $this->getMultiple(null); |
| 82 | 82 | }); |
| 83 | 83 | } |
@@ -149,9 +149,9 @@ discard block |
||
| 149 | 149 | foreach ($paths as $path) { |
| 150 | 150 | // Get default value |
| 151 | 151 | $defaultValue = null; |
| 152 | - if(is_array($default)){ |
|
| 152 | + if (is_array($default)) { |
|
| 153 | 153 | $defaultValue = Arr::get($default, $path); |
| 154 | - }else{ |
|
| 154 | + } else { |
|
| 155 | 155 | $defaultValue = $default; |
| 156 | 156 | } |
| 157 | 157 | Arr::set($array, $path, Arr::get($allFlattened, $path, $defaultValue)); |
@@ -184,9 +184,9 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | protected function forgetEmpty(&$settings, $path) { |
| 186 | 186 | // Forget path if it is empty |
| 187 | - if(!Arr::get($settings, $path)){ |
|
| 187 | + if (!Arr::get($settings, $path)) { |
|
| 188 | 188 | Arr::forget($settings, $path); |
| 189 | - }else{ |
|
| 189 | + } else { |
|
| 190 | 190 | return; |
| 191 | 191 | } |
| 192 | 192 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | array_pop($paths); |
| 198 | 198 | |
| 199 | 199 | // Return if it was the last |
| 200 | - if(count($paths) === 0){ |
|
| 200 | + if (count($paths) === 0) { |
|
| 201 | 201 | return; |
| 202 | 202 | } |
| 203 | 203 | |