@@ -31,18 +31,18 @@ discard block |
||
| 31 | 31 | public static function bootHasTranslations() |
| 32 | 32 | { |
| 33 | 33 | if (config('translatable.use_saving_service', true)) { |
| 34 | - static::saving(function (self $model) { |
|
| 34 | + static::saving(function(self $model) { |
|
| 35 | 35 | app(TranslationSavingService::class)->rememberTranslationForModel($model); |
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | - static::saved(function (self $model) { |
|
| 38 | + static::saved(function(self $model) { |
|
| 39 | 39 | app(TranslationSavingService::class)->storeTranslationOnModel($model); |
| 40 | 40 | |
| 41 | 41 | $model->refreshTranslation(); |
| 42 | 42 | }); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - static::deleting(function (self $model) { |
|
| 45 | + static::deleting(function(self $model) { |
|
| 46 | 46 | $model->purgeTranslations(); |
| 47 | 47 | }); |
| 48 | 48 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public function getTranslatable(): array |
| 132 | 132 | { |
| 133 | - if (! isset($this->translatable)) { |
|
| 133 | + if (!isset($this->translatable)) { |
|
| 134 | 134 | throw new MissingTranslationsException('Model "' . static::class . '" is missing translations'); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function storeTranslation(string $locale, array $attributes = []) |
| 156 | 156 | { |
| 157 | - if (! is_null($model = $this->translations()->where($this->getLocaleKeyName(), $locale)->first())) { |
|
| 157 | + if (!is_null($model = $this->translations()->where($this->getLocaleKeyName(), $locale)->first())) { |
|
| 158 | 158 | $model->update($attributes); |
| 159 | 159 | |
| 160 | 160 | return $model; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | public function refreshTranslation() |
| 231 | 231 | { |
| 232 | - if (! $this->exists) { |
|
| 232 | + if (!$this->exists) { |
|
| 233 | 233 | return null; |
| 234 | 234 | } |
| 235 | 235 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | public function translate(string $locale) |
| 256 | 256 | { |
| 257 | - if (! $this->exists) { |
|
| 257 | + if (!$this->exists) { |
|
| 258 | 258 | return null; |
| 259 | 259 | } |
| 260 | 260 | |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | { |
| 273 | 273 | $table = $this->getTranslationTable(); |
| 274 | 274 | |
| 275 | - return array_map(function ($item) use ($table) { |
|
| 275 | + return array_map(function($item) use ($table) { |
|
| 276 | 276 | return $table . '.' . $item; |
| 277 | 277 | }, $this->getTranslatable()); |
| 278 | 278 | } |