@@ -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]); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | public static function allSettings() : array |
187 | 187 | { |
188 | - return Cache::rememberForever('settings.all', function () { |
|
188 | + return Cache::rememberForever('settings.all', function() { |
|
189 | 189 | return $settings = self::all()->keyBy('key')->toArray(); |
190 | 190 | |
191 | 191 | foreach ($settings as $setting) { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | public static function getValidationRules() : array |
216 | 216 | { |
217 | 217 | if ('mysql' === \DB::connection()->getPDO()->getAttribute(\PDO::ATTR_DRIVER_NAME)) { |
218 | - return Cache::rememberForever('settings.rules', function () { |
|
218 | + return Cache::rememberForever('settings.rules', function() { |
|
219 | 219 | return Setting::select(\DB::raw('concat_ws("|", rules, type) as rules, `key`')) |
220 | 220 | ->pluck('rules', 'key') |
221 | 221 | ->toArray(); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | } |
224 | 224 | |
225 | 225 | |
226 | - return Cache::rememberForever('settings.rules', function () { |
|
226 | + return Cache::rememberForever('settings.rules', function() { |
|
227 | 227 | return Setting::select(\DB::raw("printf('%s|%s', rules, type) as rules, `key`")) |
228 | 228 | ->pluck('rules', 'key') |
229 | 229 | ->toArray(); |
@@ -248,13 +248,13 @@ discard block |
||
248 | 248 | { |
249 | 249 | parent::boot(); |
250 | 250 | |
251 | - static::deleted(function () { |
|
251 | + static::deleted(function() { |
|
252 | 252 | self::flushCache(); |
253 | 253 | }); |
254 | - static::updated(function () { |
|
254 | + static::updated(function() { |
|
255 | 255 | self::flushCache(); |
256 | 256 | }); |
257 | - static::created(function () { |
|
257 | + static::created(function() { |
|
258 | 258 | self::flushCache(); |
259 | 259 | }); |
260 | 260 | } |
@@ -2,7 +2,7 @@ |
||
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); |
@@ -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 |