@@ -114,11 +114,11 @@ |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
117 | - * Check if setting exists |
|
118 | - * |
|
119 | - * @param $key |
|
120 | - * @return bool |
|
121 | - */ |
|
117 | + * Check if setting exists |
|
118 | + * |
|
119 | + * @param $key |
|
120 | + * @return bool |
|
121 | + */ |
|
122 | 122 | public static function has(string $key) : bool |
123 | 123 | { |
124 | 124 | return (boolean) isset(self::allSettings()[$key]); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public static function allSettings() : array |
192 | 192 | { |
193 | - return Cache::rememberForever('settings.all', function () { |
|
193 | + return Cache::rememberForever('settings.all', function() { |
|
194 | 194 | return $settings = self::all()->keyBy('key')->toArray(); |
195 | 195 | }); |
196 | 196 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | public static function getValidationRules() : array |
215 | 215 | { |
216 | 216 | if ('mysql' === \DB::connection()->getPDO()->getAttribute(\PDO::ATTR_DRIVER_NAME)) { |
217 | - return Cache::rememberForever('settings.rules', function () { |
|
217 | + return Cache::rememberForever('settings.rules', function() { |
|
218 | 218 | return Setting::select(\DB::raw('concat_ws("|", rules, type) as rules, `key`')) |
219 | 219 | ->pluck('rules', 'key') |
220 | 220 | ->toArray(); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | } |
223 | 223 | |
224 | 224 | |
225 | - return Cache::rememberForever('settings.rules', function () { |
|
225 | + return Cache::rememberForever('settings.rules', function() { |
|
226 | 226 | return Setting::select(\DB::raw("printf('%s|%s', rules, type) as rules, `key`")) |
227 | 227 | ->pluck('rules', 'key') |
228 | 228 | ->toArray(); |
@@ -247,13 +247,13 @@ discard block |
||
247 | 247 | { |
248 | 248 | parent::boot(); |
249 | 249 | |
250 | - static::deleted(function () { |
|
250 | + static::deleted(function() { |
|
251 | 251 | self::flushCache(); |
252 | 252 | }); |
253 | - static::updated(function () { |
|
253 | + static::updated(function() { |
|
254 | 254 | self::flushCache(); |
255 | 255 | }); |
256 | - static::created(function () { |
|
256 | + static::created(function() { |
|
257 | 257 | self::flushCache(); |
258 | 258 | }); |
259 | 259 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | ], 'config'); |
14 | 14 | |
15 | 15 | $this->publishes([ |
16 | - __DIR__ . '/../database/migrations/0000_00_00__create_settings_table.php' => base_path() . '/database/migrations/'. date('Y_m_d_His', time()) . '_create_settings_table.php' |
|
16 | + __DIR__ . '/../database/migrations/0000_00_00__create_settings_table.php' => base_path() . '/database/migrations/' . date('Y_m_d_His', time()) . '_create_settings_table.php' |
|
17 | 17 | ], 'migrations'); |
18 | 18 | } |
19 | 19 |
@@ -2,14 +2,14 @@ |
||
2 | 2 | |
3 | 3 | use \Ottosmops\Settings\Setting; |
4 | 4 | |
5 | -if (! function_exists('setting')) { |
|
5 | +if (!function_exists('setting')) { |
|
6 | 6 | function setting($key, $default = null) |
7 | 7 | { |
8 | 8 | return Setting::getValue($key, $default); |
9 | 9 | } |
10 | 10 | } |
11 | 11 | |
12 | -if (! function_exists('settingAsString')) { |
|
12 | +if (!function_exists('settingAsString')) { |
|
13 | 13 | function settingAsString($key, $default = null) |
14 | 14 | { |
15 | 15 | return Setting::getValueAsString($key, $default); |