hasMany(Notification::class); } /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'name', 'username', 'nik', 'email', 'password', 'role', 'skill', 'attendance_enabled', 'is_approved', 'email_verification_code', ]; /** * The attributes that should be hidden for serialization. * * @var list */ protected $hidden = [ 'password', 'remember_token', ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'attendance_enabled' => 'boolean', 'is_approved' => 'boolean', ]; } public function attendances() { return $this->hasMany(Attendance::class); } /** * Get the skill label * * @return string */ public function getSkillLabelAttribute() { return match($this->skill) { 'mechanic' => 'Mekanik', 'welder' => 'Welder', default => 'Belum diatur', }; } }