@@ -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]); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $value = str_replace('ç€π', '\\', $value); |
157 | 157 | $value = str_replace('@ƻ', '/', $value); |
158 | 158 | case 'string': |
159 | - $value = trim($value, '"'); |
|
159 | + $value = trim($value, '"'); |
|
160 | 160 | default: |
161 | 161 | return (string) $value; |
162 | 162 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | if ($setting->type === 'boolean' && is_string($value)) { |
238 | 238 | $value = ($value === 'false') ? false : $value; |
239 | - $value = ($value === 'true') ? true : $value; |
|
239 | + $value = ($value === 'true') ? true : $value; |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | if ($validate && !$setting->validateNewValue($value)) { |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public static function allSettings() : array |
273 | 273 | { |
274 | - return Cache::rememberForever('settings.all', function () { |
|
274 | + return Cache::rememberForever('settings.all', function() { |
|
275 | 275 | return $settings = self::all()->keyBy('key')->toArray(); |
276 | 276 | }); |
277 | 277 | } |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | public static function getValidationRules() : array |
300 | 300 | { |
301 | 301 | if ('mysql' === \DB::connection()->getPDO()->getAttribute(\PDO::ATTR_DRIVER_NAME)) { |
302 | - return Cache::rememberForever('settings.rules', function () { |
|
302 | + return Cache::rememberForever('settings.rules', function() { |
|
303 | 303 | return Setting::select(\DB::raw('concat_ws("|", rules, type) as rules, `key`')) |
304 | 304 | ->pluck('rules', 'key') |
305 | 305 | ->toArray(); |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | |
310 | - return Cache::rememberForever('settings.rules', function () { |
|
310 | + return Cache::rememberForever('settings.rules', function() { |
|
311 | 311 | return Setting::select(\DB::raw("printf('%s|%s', rules, type) as rules, `key`")) |
312 | 312 | ->pluck('rules', 'key') |
313 | 313 | ->toArray(); |
@@ -332,13 +332,13 @@ discard block |
||
332 | 332 | { |
333 | 333 | parent::boot(); |
334 | 334 | |
335 | - static::deleted(function () { |
|
335 | + static::deleted(function() { |
|
336 | 336 | self::flushCache(); |
337 | 337 | }); |
338 | - static::updated(function () { |
|
338 | + static::updated(function() { |
|
339 | 339 | self::flushCache(); |
340 | 340 | }); |
341 | - static::created(function () { |
|
341 | + static::created(function() { |
|
342 | 342 | self::flushCache(); |
343 | 343 | }); |
344 | 344 | } |
@@ -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); |