We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -8,61 +8,61 @@ |
||
8 | 8 | |
9 | 9 | class Setting extends Model |
10 | 10 | { |
11 | - use CrudTrait; |
|
11 | + use CrudTrait; |
|
12 | 12 | |
13 | - protected $fillable = ['value']; |
|
13 | + protected $fillable = ['value']; |
|
14 | 14 | |
15 | - public function __construct(array $attributes = []) |
|
16 | - { |
|
17 | - parent::__construct($attributes); |
|
15 | + public function __construct(array $attributes = []) |
|
16 | + { |
|
17 | + parent::__construct($attributes); |
|
18 | 18 | |
19 | - $this->table = config('backpack.settings.table_name'); |
|
20 | - } |
|
19 | + $this->table = config('backpack.settings.table_name'); |
|
20 | + } |
|
21 | 21 | |
22 | - /** |
|
23 | - * Grab a setting value from the database. |
|
24 | - * |
|
25 | - * @param string $key The setting key, as defined in the key db column |
|
26 | - * |
|
27 | - * @return string The setting value. |
|
28 | - */ |
|
29 | - public static function get($key, $default = null) |
|
30 | - { |
|
31 | - $setting = new self(); |
|
32 | - $entry = $setting->where('key', $key)->first(); |
|
22 | + /** |
|
23 | + * Grab a setting value from the database. |
|
24 | + * |
|
25 | + * @param string $key The setting key, as defined in the key db column |
|
26 | + * |
|
27 | + * @return string The setting value. |
|
28 | + */ |
|
29 | + public static function get($key, $default = null) |
|
30 | + { |
|
31 | + $setting = new self(); |
|
32 | + $entry = $setting->where('key', $key)->first(); |
|
33 | 33 | |
34 | - if (!$entry) { |
|
35 | - return $default; |
|
36 | - } |
|
34 | + if (!$entry) { |
|
35 | + return $default; |
|
36 | + } |
|
37 | 37 | |
38 | - return $entry->value; |
|
39 | - } |
|
38 | + return $entry->value; |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * Update a setting's value. |
|
43 | - * |
|
44 | - * @param string $key The setting key, as defined in the key db column |
|
45 | - * @param string $value The new value. |
|
46 | - */ |
|
47 | - public static function set($key, $value = null) |
|
48 | - { |
|
49 | - $database_prefix = config('backpack.settings.database_prefix'); |
|
41 | + /** |
|
42 | + * Update a setting's value. |
|
43 | + * |
|
44 | + * @param string $key The setting key, as defined in the key db column |
|
45 | + * @param string $value The new value. |
|
46 | + */ |
|
47 | + public static function set($key, $value = null) |
|
48 | + { |
|
49 | + $database_prefix = config('backpack.settings.database_prefix'); |
|
50 | 50 | |
51 | - $prefixed_key = !empty($database_prefix) ? $database_prefix.'.'.$key : $key; |
|
52 | - $setting = new self(); |
|
53 | - $entry = $setting->where('key', $key)->firstOrFail(); |
|
51 | + $prefixed_key = !empty($database_prefix) ? $database_prefix.'.'.$key : $key; |
|
52 | + $setting = new self(); |
|
53 | + $entry = $setting->where('key', $key)->firstOrFail(); |
|
54 | 54 | |
55 | - // update the value in the database |
|
56 | - $entry->value = $value; |
|
57 | - $entry->saveOrFail(); |
|
55 | + // update the value in the database |
|
56 | + $entry->value = $value; |
|
57 | + $entry->saveOrFail(); |
|
58 | 58 | |
59 | - // update the value in the session |
|
60 | - Config::set($prefixed_key, $value); |
|
59 | + // update the value in the session |
|
60 | + Config::set($prefixed_key, $value); |
|
61 | 61 | |
62 | - if (Config::get($prefixed_key) == $value) { |
|
63 | - return true; |
|
64 | - } |
|
62 | + if (Config::get($prefixed_key) == $value) { |
|
63 | + return true; |
|
64 | + } |
|
65 | 65 | |
66 | - return false; |
|
67 | - } |
|
66 | + return false; |
|
67 | + } |
|
68 | 68 | } |