public function create(NoticeCreateBuilder $notice_create) { $this->notification_model = new Notification(); if ($notice_create->id) { $uuid = $notice_create->id; $this->notification_model->id = $notice_create->id; } else { $uuid = $this->generateNewId()->toString(); $this->notification_model->id = $uuid; } $this->notification_model->from_id = $notice_create->from_id; $this->notification_model->from_type = $notice_create->from_type; $this->notification_model->notification_message_id = $notice_create->message_id; $this->notification_model->to_id = $notice_create->to_id; $this->notification_model->to_type = $notice_create->to_type; $this->notification_model->notification_category_id = $notice_create->category_id; $this->notification_model->save(); return $this->notification_model; }