@@ -10,13 +10,13 @@ discard block |
||
| 10 | 10 | # Boot the HasSettingsBag trait. |
| 11 | 11 | public static function bootHasSettingsBag(): void |
| 12 | 12 | { |
| 13 | - self::creating(function ($model) { |
|
| 13 | + self::creating(function($model) { |
|
| 14 | 14 | if (!$model->settings) { |
| 15 | 15 | $model->settings = $model->getDefaultSettings() ?: null; |
| 16 | 16 | } |
| 17 | 17 | }); |
| 18 | 18 | |
| 19 | - self::saving(function ($model) { |
|
| 19 | + self::saving(function($model) { |
|
| 20 | 20 | if ($model->settings && property_exists($model, 'allowedSettings') && is_array($model->allowedSettings)) { |
| 21 | 21 | $model->settings = Arr::only($model->settings, $model->allowedSettings); |
| 22 | 22 | } |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | return new SettingsBag($this); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $settingRelation = $settingName . 'SettingsBag'; |
|
| 53 | + $settingRelation = $settingName.'SettingsBag'; |
|
| 54 | 54 | if (!method_exists($this, $settingRelation) || !in_array(__TRAIT__, class_uses($this->{$settingRelation}))) { |
| 55 | - throw new Exception($settingName . ' setting not available on ' . get_class($this) . ' model'); |
|
| 55 | + throw new Exception($settingName.' setting not available on '.get_class($this).' model'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $settingModel = $this->{$settingRelation}; |