@@ -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 | } |
@@ -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 | |
@@ -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 | /** |
@@ -71,21 +71,21 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public static function isDuplicated($inputs){ |
| 73 | 73 | |
| 74 | - $exists = self::where('student_id','=',$inputs['student_id']) |
|
| 75 | - ->where('institution_subject_id','=',$inputs['institution_subject_id']) |
|
| 76 | - ->where('education_subject_id','=',$inputs['education_subject_id'])->count(); |
|
| 74 | + $exists = self::where('student_id','=',$inputs['student_id']) |
|
| 75 | + ->where('institution_subject_id','=',$inputs['institution_subject_id']) |
|
| 76 | + ->where('education_subject_id','=',$inputs['education_subject_id'])->count(); |
|
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | return $exists ? true :false; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | - public function student(){ |
|
| 83 | + public function student(){ |
|
| 84 | 84 | return $this->belongsTo('App\Models\Security_user','student_id'); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | public static function getStudentsCount(){ |
| 88 | - $total_male_students = self::with(['student' => function($query) { |
|
| 88 | + $total_male_students = self::with(['student' => function($query) { |
|
| 89 | 89 | $query->where('student.gender_id', '=', 1); |
| 90 | 90 | }])->whereHas('student', function ($query) { |
| 91 | 91 | $query->where('gender_id', '=', 1); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | protected $dates = ['modified', 'created']; |
| 43 | 43 | |
| 44 | 44 | public function shiftExists($shift){ |
| 45 | - return self::query() |
|
| 45 | + return self::query() |
|
| 46 | 46 | ->where('institution_id',$shift['institution_id']) |
| 47 | 47 | ->where('location_institution_id',$shift['location_institution_id']) |
| 48 | 48 | ->where('shift_option_id',$shift['shift_option_id']) |