private function getValue(array $values, $languages, $group, $parent = NULL)
    {
    	foreach($values as $key => $value){

			foreach($languages as $language){
				$entry = Translation::firstOrCreate([
					'key' => $key,
					'language' => $language,
					'translation_group' => $group->id,
					'parent' => $parent
				]);
				if(is_array($value)){
					$this->getValue($value, $languages, $group, $entry->id);
				} else {
					if($entry->value === NULL){
						$entry->value = $value;
						$entry->save();
					}
				}
			}
	    }
    }
private function getValue(array $values, $languages, $group, $parent = NULL)
    {
    	foreach($values as $key => $value){

			foreach($languages as $language){
				$entry = Translation::firstOrCreate([
					'key' => $key,
					'language' => $language,
					'translation_group' => $group->id,
					'parent' => $parent
				]);
				if(is_array($value)){
					$this->getValue($value, $languages, $group, $entry->id);
				} else {
					if($entry->value === NULL){
						$entry->value = $value;
						$entry->save();
					}
				}
			}
	    }
    }
private function getValue ( array $ values , $ languages , $ group , $ parent = NULL ) { foreach ( $ values as $ key => $ value ) { foreach ( $ languages as $ language ) { $ entry = Translation :: firstOrCreate ( [ 'key' => $ key , 'language' => $ language , 'translation_group' => $ group -> id , 'parent' => $ parent ] ) ; if ( is_array ( $ value ) ) { $ this -> getValue ( $ value , $ languages , $ group , $ entry -> id ) ; } else { if ( $ entry -> value === NULL ) { $ entry -> value = $ value ; $ entry -> save ( ) ; } } } } }
Writes all translation to database.
Updates values, if they already exist.
Keeps care of multidimensional arrays.
@param array $values
@param $language
@param $group
@param null $parent
Writes all translation to database . Updates values if they already exist . Keeps care of multidimensional arrays .