Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | protected function updateTranslations(Model $model, FormRequest $request) |
||
11 | { |
||
12 | foreach (config('app.locales') as $locale) { |
||
13 | foreach ($model->getTranslatableAttributes() as $fieldName) { |
||
14 | $translatedFieldName = translate_field_name($fieldName, $locale); |
||
15 | |||
16 | if (!$request->has($translatedFieldName)) { |
||
17 | continue; |
||
18 | } |
||
19 | |||
20 | $model->setTranslation($fieldName, $locale, $request->get($translatedFieldName)); |
||
21 | } |
||
22 | } |
||
23 | } |
||
24 | } |
||
25 |