setAttribute('birth_day', $value); } public function setGenderAttribute($value) { $this->setAttribute('gender', $value); } public function setAgeAttribute($value) { $this->setAttribute('age', $value); } public function getBirthdayAttribute() { $value = $this->getAttribute('birthday'); if (empty($value)) { return null; } return Carbon::parse($value)->format('Y-m-d'); } public function getGenderAttribute() { $value = $this->getAttribute('gender'); if (empty($value)) { return null; } return $value; } public function getAgeAttribute() { $value = $this->getAttribute('age'); if (empty($value)) { return null; } return (int) $value; } }