| @@ -423,8 +423,9 @@ | ||
| 423 | 423 | } | 
| 424 | 424 | |
| 425 | 425 |      protected function insertSubject($subject){ | 
| 426 | - if(!Institution_subject_student::isDuplicated($subject)) | |
| 427 | - Institution_subject_student::updateOrInsert($subject); | |
| 426 | +        if(!Institution_subject_student::isDuplicated($subject)) { | |
| 427 | + Institution_subject_student::updateOrInsert($subject); | |
| 428 | + } | |
| 428 | 429 | } | 
| 429 | 430 | |
| 430 | 431 | |
| @@ -18,10 +18,10 @@ | ||
| 18 | 18 | } | 
| 19 | 19 | |
| 20 | 20 | /** | 
| 21 | - * @param array $row | |
| 22 | - * | |
| 23 | - * @return \Illuminate\Database\Eloquent\Model|null | |
| 24 | - */ | |
| 21 | + * @param array $row | |
| 22 | + * | |
| 23 | + * @return \Illuminate\Database\Eloquent\Model|null | |
| 24 | + */ | |
| 25 | 25 | |
| 26 | 26 | public function sheets(): array | 
| 27 | 27 |      { | 
| @@ -25,11 +25,11 @@ | ||
| 25 | 25 | * | 
| 26 | 26 | * @return void | 
| 27 | 27 | */ | 
| 28 | - public function boot() | |
| 29 | -     { | |
| 30 | - // | |
| 31 | -         if((\App::environment('dev')) |  (\App::environment('stage')) | (\App::environment('prod'))) { | |
| 32 | -             URL::forceScheme('https'); | |
| 33 | - } | |
| 34 | - } | |
| 28 | + public function boot() | |
| 29 | +        { | |
| 30 | + // | |
| 31 | +            if((\App::environment('dev')) |  (\App::environment('stage')) | (\App::environment('prod'))) { | |
| 32 | +                URL::forceScheme('https'); | |
| 33 | + } | |
| 34 | + } | |
| 35 | 35 | } | 
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | |
| 12 | 12 |      public function boot() { | 
| 13 | 13 | $this->app->validator->resolver( function( $translator, $data, $rules, | 
| 14 | -                                                   $messages = array(), $customAttributes = array() ) { | |
| 14 | +                                                    $messages = array(), $customAttributes = array() ) { | |
| 15 | 15 | return new ValidatorExtended( $translator, $data, $rules, $messages, | 
| 16 | 16 | $customAttributes ); | 
| 17 | 17 | } ); | 
| @@ -52,8 +52,8 @@ discard block | ||
| 52 | 52 | protected function mapWebRoutes() | 
| 53 | 53 |      { | 
| 54 | 54 |          Route::middleware('web') | 
| 55 | - ->namespace($this->namespace) | |
| 56 | -             ->group(base_path('routes/web.php')); | |
| 55 | + ->namespace($this->namespace) | |
| 56 | +                ->group(base_path('routes/web.php')); | |
| 57 | 57 | } | 
| 58 | 58 | |
| 59 | 59 | /** | 
| @@ -66,8 +66,8 @@ discard block | ||
| 66 | 66 | protected function mapApiRoutes() | 
| 67 | 67 |      { | 
| 68 | 68 |          Route::prefix('api') | 
| 69 | -             ->middleware('api') | |
| 70 | - ->namespace($this->namespace) | |
| 71 | -             ->group(base_path('routes/api.php')); | |
| 69 | +                ->middleware('api') | |
| 70 | + ->namespace($this->namespace) | |
| 71 | +                ->group(base_path('routes/api.php')); | |
| 72 | 72 | } | 
| 73 | 73 | } | 
| @@ -50,14 +50,14 @@ | ||
| 50 | 50 | unset($files); | 
| 51 | 51 | exit(); | 
| 52 | 52 | |
| 53 | -                }else{ | |
| 53 | +                } else{ | |
| 54 | 54 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); | 
| 55 | 55 |                      $output->writeln('No files found,Waiting for files'); | 
| 56 | 56 | exit(); | 
| 57 | 57 | |
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | -            }catch (Exception $e){ | |
| 60 | +            } catch (Exception $e){ | |
| 61 | 61 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); | 
| 62 | 62 | $output->writeln($e); | 
| 63 | 63 | sleep(300); | 
| @@ -78,41 +78,41 @@ | ||
| 78 | 78 | $this->count += 1; | 
| 79 | 79 | $this->student = $student ; | 
| 80 | 80 |              try{ | 
| 81 | - Institution_student::create([ | |
| 82 | - 'student_status_id' => 1, | |
| 83 | - 'student_id' => $student['student_id'], | |
| 84 | - 'education_grade_id' => $student['education_grade_id'], | |
| 85 | - 'academic_period_id' => $student['academic_period_id'], | |
| 86 | - 'start_date' => $student['start_date'], | |
| 87 | -                   'start_year' => \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $student['start_date'])->year , // $student['start_date']->format('Y'), | |
| 88 | - 'end_date' => $student['end_date'], | |
| 89 | -                   'end_year' =>  \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $student['end_date'])->year , //$student['end_date']->format('Y'), | |
| 90 | - 'institution_id' => $student['institution_id'], | |
| 91 | - 'admission_id' => $student['admission_id'], | |
| 92 | - 'created_user_id' => $student['created_user_id'], | |
| 93 | - ]); | |
| 94 | - | |
| 95 | -               if(!is_null($student['institution_class_id'])){ | |
| 96 | - Institution_class_student::create([ | |
| 97 | - 'student_id' => $student['student_id'], | |
| 98 | - 'institution_class_id' => $student['institution_class_id'], | |
| 99 | - 'education_grade_id' => $student['education_grade_id'], | |
| 100 | - 'academic_period_id' => $student['academic_period_id'], | |
| 101 | - 'institution_id' =>$student['institution_id'], | |
| 102 | - 'student_status_id' => 1, | |
| 103 | - 'created_user_id' => $student['created_user_id'], | |
| 104 | - ]); | |
| 105 | - } | |
| 81 | + Institution_student::create([ | |
| 82 | + 'student_status_id' => 1, | |
| 83 | + 'student_id' => $student['student_id'], | |
| 84 | + 'education_grade_id' => $student['education_grade_id'], | |
| 85 | + 'academic_period_id' => $student['academic_period_id'], | |
| 86 | + 'start_date' => $student['start_date'], | |
| 87 | +                    'start_year' => \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $student['start_date'])->year , // $student['start_date']->format('Y'), | |
| 88 | + 'end_date' => $student['end_date'], | |
| 89 | +                    'end_year' =>  \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $student['end_date'])->year , //$student['end_date']->format('Y'), | |
| 90 | + 'institution_id' => $student['institution_id'], | |
| 91 | + 'admission_id' => $student['admission_id'], | |
| 92 | + 'created_user_id' => $student['created_user_id'], | |
| 93 | + ]); | |
| 94 | + | |
| 95 | +                if(!is_null($student['institution_class_id'])){ | |
| 96 | + Institution_class_student::create([ | |
| 97 | + 'student_id' => $student['student_id'], | |
| 98 | + 'institution_class_id' => $student['institution_class_id'], | |
| 99 | + 'education_grade_id' => $student['education_grade_id'], | |
| 100 | + 'academic_period_id' => $student['academic_period_id'], | |
| 101 | + 'institution_id' =>$student['institution_id'], | |
| 102 | + 'student_status_id' => 1, | |
| 103 | + 'created_user_id' => $student['created_user_id'], | |
| 104 | + ]); | |
| 105 | + } | |
| 106 | 106 |                  $output->writeln(' | 
| 107 | 107 | #################################################### | 
| 108 | 108 | Total number of students updated : '.$this->count.' | 
| 109 | 109 | # # | 
| 110 | 110 | ####################################################' ); | 
| 111 | 111 | // $output->writeln(); | 
| 112 | -           }catch (\Exception $e){ | |
| 112 | +            }catch (\Exception $e){ | |
| 113 | 113 | // echo $e->getMessage(); | 
| 114 | - $output->writeln( $e->getMessage()); | |
| 115 | - } | |
| 114 | + $output->writeln( $e->getMessage()); | |
| 115 | + } | |
| 116 | 116 | } | 
| 117 | 117 | } | 
| 118 | 118 | |
| @@ -109,7 +109,7 @@ | ||
| 109 | 109 | # # | 
| 110 | 110 | ####################################################' ); | 
| 111 | 111 | // $output->writeln(); | 
| 112 | -           }catch (\Exception $e){ | |
| 112 | +           } catch (\Exception $e){ | |
| 113 | 113 | // echo $e->getMessage(); | 
| 114 | 114 | $output->writeln( $e->getMessage()); | 
| 115 | 115 | } | 
| @@ -25,8 +25,8 @@ | ||
| 25 | 25 | */ | 
| 26 | 26 | protected function schedule(Schedule $schedule) | 
| 27 | 27 |      { | 
| 28 | -         $schedule->command('import:students') | |
| 29 | -                  ->cron('* * * * * '); | |
| 28 | +            $schedule->command('import:students') | |
| 29 | +                    ->cron('* * * * * '); | |
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | 32 | /** | 
| @@ -107,8 +107,8 @@ | ||
| 107 | 107 | * @return mixed | 
| 108 | 108 | */ | 
| 109 | 109 |      public function getInstitutionGrade($institutionId, $gradeId){ | 
| 110 | -         return self::where('education_grade_id',$gradeId) | |
| 111 | -             ->where('institution_id',$institutionId)->get()->first(); | |
| 110 | +            return self::where('education_grade_id',$gradeId) | |
| 111 | +                ->where('institution_id',$institutionId)->get()->first(); | |
| 112 | 112 | } | 
| 113 | 113 | |
| 114 | 114 | /** | 
| @@ -83,7 +83,7 @@ | ||
| 83 | 83 |                  ->where('institution_grades.education_grade_id', $educationGradeId) | 
| 84 | 84 |                  ->where('institution_grades.institution_id', $institutionId) | 
| 85 | 85 | ->get(); | 
| 86 | -        }else{ | |
| 86 | +        } else{ | |
| 87 | 87 | return null; | 
| 88 | 88 | } | 
| 89 | 89 | } |