private function addTranslationsToArray($array = []): array
    {
        foreach($array as $language => $groups){
            foreach($groups as $groupname => $entries){
                $group_model = TranslationGroup::where('name', $groupname)->first();
                $first_level_translations = Translation::where([
                    ['parent', '=', NULL],
                    ['translation_group', '=', $group_model->id],
                    ['language', '=', $language]
                ])->get();
                
                foreach($first_level_translations as $translation){
                    $array[$language][$groupname][$translation->key] = $this->getValue($language, $translation, $group_model);
                }

            }
        }
        return $array;
    }
private function addTranslationsToArray($array = []): array
    {
        foreach($array as $language => $groups){
            foreach($groups as $groupname => $entries){
                $group_model = TranslationGroup::where('name', $groupname)->first();
                $first_level_translations = Translation::where([
                    ['parent', '=', NULL],
                    ['translation_group', '=', $group_model->id],
                    ['language', '=', $language]
                ])->get();
                
                foreach($first_level_translations as $translation){
                    $array[$language][$groupname][$translation->key] = $this->getValue($language, $translation, $group_model);
                }

            }
        }
        return $array;
    }
private function addTranslationsToArray ( $ array = [ ] ) : array { foreach ( $ array as $ language => $ groups ) { foreach ( $ groups as $ groupname => $ entries ) { $ group_model = TranslationGroup :: where ( 'name' , $ groupname ) -> first ( ) ; $ first_level_translations = Translation :: where ( [ [ 'parent' , '=' , NULL ] , [ 'translation_group' , '=' , $ group_model -> id ] , [ 'language' , '=' , $ language ] ] ) -> get ( ) ; foreach ( $ first_level_translations as $ translation ) { $ array [ $ language ] [ $ groupname ] [ $ translation -> key ] = $ this -> getValue ( $ language , $ translation , $ group_model ) ; } } } return $ array ; }
Collects all relevant translations from database and writes them to the
correct array-field.

@return array
Collects all relevant translations from database and writes them to the correct array - field .