belongsTo('App\Models\Webinar', 'webinar_id', 'id'); } public function creator() { return $this->belongsTo('App\User', 'creator_id', 'id'); } public function noticeboardStatus() { return $this->hasOne('App\Models\CourseNoticeboardStatus', 'noticeboard_id', 'id'); } public function getIcon() { $icons = [ 'warning' => 'alert-triangle', 'danger' => 'alert-octagon', 'neutral' => 'shield', 'info' => 'message-square', 'success' => 'check-circle' ]; return $icons[$this->color]; } }