protected function getRelationValue(array $dictionary, $key, $type) { $value = $dictionary[$key]; return $type == 'one' ? reset($value) : $this->related->newCollection($value); }