protected function getArrayableItems(array $values) { if (count($this->getVisible()) > 0) { return array_intersect_key($values, array_flip($this->getVisible())); } return array_diff_key($values, array_flip($this->getHidden())); }