question, 0, 36); $course = $this->findCourse($consult->course_id); $notification = new NotificationModel(); $notification->sender_id = $sender->id; $notification->receiver_id = $consult->owner_id; $notification->event_id = $consult->id; $notification->event_type = NotificationModel::TYPE_CONSULT_LIKED; $notification->event_info = [ 'course' => ['id' => $course->id, 'title' => $course->title], 'consult' => ['id' => $consult->id, 'question' => $consultQuestion], ]; $notification->create(); } protected function findCourse($id) { $courseRepo = new CourseRepo(); return $courseRepo->findById($id); } }