private function createFromExcel()
 {
     $semester_id = semester()->id;
     $results = Excel::load($this->filename)->get()->all();
     // dd(get_class_methods($results));
     $subjects_codes = [];
     $teachers_usernames = [];
     $classrooms_codes = [];
     foreach ($results as $sheet) {
         $item = $sheet->all();
         if (empty($item[1]) || empty($item[2]) || empty($item[3])) {
             continue;
         }
         $teachers_usernames[] = $item[2];
         $subjects_codes[] = $item[1];
         $classrooms_codes[] = $item[3];
     }
     $teachers = Teacher::whereIn('username', $teachers_usernames)->pluck('id', 'username')->toArray();
     $subjects = Subject::whereIn('code', $subjects_codes)->pluck('id', 'code')->toArray();
     $classrooms = Classroom::whereIn('code', $classrooms_codes)->inCurrentSemester()->pluck('id', 'code')->toArray();
     $new_classrooms = [];
     foreach ($results as $sheet) {
         $item = $sheet->all();
         if (empty($item[1]) || empty($item[2]) || empty($item[3])) {
             continue;
         }
         if (!isset($classrooms[$item[3]]) && isset($teachers[$item[2]]) && isset($subjects[$item[1]]) && in_array($item[5], ['m', 'f', 'b'])) {
             $new_classrooms[] = ['code' => $item[3], 'day' => $item[4] - 1, 'gender' => $item[5], 'teacher_id' => $teachers[$item[2]], 'subject_subject_id' => $subjects[$item[1]], 'semester_id' => $semester_id, 'attendees_limit' => 100, 'created_at' => new DateTime(), 'updated_at' => new DateTime()];
         }
     }
     if (!empty($new_classrooms)) {
         Classroom::insert($new_classrooms);
     }
     event(new CreateClassroomsFromExcelFinished());
 }