content, 0, 32); $course = $this->findCourse($review->course_id); $notification = new NotificationModel(); $notification->sender_id = $sender->id; $notification->receiver_id = $review->owner_id; $notification->event_id = $review->id; $notification->event_type = NotificationModel::TYPE_REVIEW_LIKED; $notification->event_info = [ 'course' => ['id' => $course->id, 'title' => $course->title], 'review' => ['id' => $review->id, 'content' => $reviewContent], ]; $notification->create(); } protected function findCourse($id) { $courseRepo = new CourseRepo(); return $courseRepo->findById($id); } }