/** * Convert the model's attributes to an array. * * @return array */ public function attributesToArray() { $attributes = parent::attributesToArray(); foreach ($this->getMagicMeta() as $meta_key => $key) { $attributes[$key] = $this->getMetaValue($meta_key); } return $attributes; }