public function getTypeAttribute() { $type = $this->type_from_extension; if ($type !== self::TYPE_OTHER) { return $type; } return $this->type_from_mime; }