diff --git a/app/Http/Controllers/Api/LessonScheduleApiController.php b/app/Http/Controllers/Api/LessonScheduleApiController.php index 5a9b8161..e9c14b9d 100644 --- a/app/Http/Controllers/Api/LessonScheduleApiController.php +++ b/app/Http/Controllers/Api/LessonScheduleApiController.php @@ -71,7 +71,7 @@ public function create(LessonSchedule $lessonSchedule) public function show(LessonSchedule $lessonSchedule) { $classroomStudents = $this->classroomStudent->getByClassId($lessonSchedule->classroom->id); - $attendanceJournals = $lessonSchedule->teacherJournals->first()->attendanceJournals == null ? null : $lessonSchedule->teacherJournals->first()->attendanceJournals; + $attendanceJournals = $lessonSchedule->teacherJournals->first() != null ? $lessonSchedule->teacherJournals->first()->attendanceJournals : null; return response()->json([ 'status' => 'success',