table member dan table benefit
This commit is contained in:
@@ -107,4 +107,27 @@ class Person extends Model
|
||||
{
|
||||
return $this->morphMany(AppointmentParticipant::class, 'participantable');
|
||||
}
|
||||
|
||||
public function setGenderAttribute($value)
|
||||
{
|
||||
if ($value == "M" || $value == "L") {
|
||||
return $this->attributes['gender'] = "male";
|
||||
} else if ($value == "F" || $value == "P") {
|
||||
return $this->attributes['gender'] = "female";
|
||||
} else {
|
||||
return $this->attributes['gender'] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
public function getGenderAttribute()
|
||||
{
|
||||
|
||||
if ($this->attributes['gender'] == "male" || $this->attributes['gender'] == "L") {
|
||||
return "male";
|
||||
} else if ($this->attributes['gender'] == "female" || $this->attributes['gender'] == "P") {
|
||||
return "female";
|
||||
} else {
|
||||
return "other";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user