@@ -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 | /** |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | public function __construct($class) { |
32 | 32 | |
33 | 33 | $this->class = $class; |
34 | - $this->_file_name = time() . '_' . Auth::user()->id . '_' . 'student_upload.xls'; |
|
34 | + $this->_file_name = time().'_'.Auth::user()->id.'_'.'student_upload.xls'; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | public function registerEvents(): array { |
38 | 38 | return [ |
39 | - BeforeSheet::class => function(BeforeSheet $event){ |
|
39 | + BeforeSheet::class => function(BeforeSheet $event) { |
|
40 | 40 | // dd($event->crea) |
41 | 41 | }, |
42 | 42 | BeforeWriting::class => function(BeforeWriting $event) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $class = $this->class; |
64 | 64 | return Security_user::select('openemis_no', 'first_name', 'gender_id', 'date_of_birth', 'address', 'birthplace_area_id') |
65 | 65 | ->with(['class', 'special_needs']) |
66 | - ->whereHas('class', function ($query) use ($class) { |
|
66 | + ->whereHas('class', function($query) use ($class) { |
|
67 | 67 | $query->where('institution_class_id', '=', $class); |
68 | 68 | }) |
69 | 69 | ->get(); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class User_body_mass extends Base_Model { |
|
7 | +class User_body_mass extends Base_Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Institution_staff extends Model { |
|
7 | +class Institution_staff extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | protected $dates = ['start_date', 'end_date', 'modified', 'created']; |
43 | 43 | |
44 | 44 | |
45 | - public function staff_class(){ |
|
46 | - return $this->hasMany('App\Models\Institution_class','staff_id','staff_id'); |
|
45 | + public function staff_class() { |
|
46 | + return $this->hasMany('App\Models\Institution_class', 'staff_id', 'staff_id'); |
|
47 | 47 | } |
48 | 48 | |
49 | - public function institution(){ |
|
50 | - return $this->belongsTo('App\Models\Institution','institution_id'); |
|
49 | + public function institution() { |
|
50 | + return $this->belongsTo('App\Models\Institution', 'institution_id'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Nationality extends Model { |
|
7 | +class Nationality extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Workflow_transition extends Model { |
|
7 | +class Workflow_transition extends Model { |
|
8 | 8 | |
9 | 9 | public const CREATED_AT = 'created'; |
10 | 10 | public const UPDATED_AT = 'modified'; |
@@ -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,11 +71,11 @@ discard block |
||
71 | 71 | { |
72 | 72 | if (!is_null($id)) { |
73 | 73 | return self::find($id) |
74 | - ->select('institution_grades.id as insGrade','institution_classes.id', 'institution_classes.name', 'institution_grades.education_grade_id') |
|
75 | - ->join('institution_classes', function ($join) use ($educationGradeId, $academicPeriodId) { |
|
74 | + ->select('institution_grades.id as insGrade', 'institution_classes.id', 'institution_classes.name', 'institution_grades.education_grade_id') |
|
75 | + ->join('institution_classes', function($join) use ($educationGradeId, $academicPeriodId) { |
|
76 | 76 | $join->on('institution_classes.institution_id', '=', 'institution_grades.institution_id') |
77 | 77 | ->where('institution_classes.academic_period_id', $academicPeriodId) |
78 | - ->join('institution_class_grades', function ($join) use ($educationGradeId) { |
|
78 | + ->join('institution_class_grades', function($join) use ($educationGradeId) { |
|
79 | 79 | $join->on('institution_class_grades.institution_class_id', '=', 'institution_classes.id') |
80 | 80 | ->where('institution_class_grades.education_grade_id', $educationGradeId); |
81 | 81 | }); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ->where('institution_grades.institution_id', $institutionId) |
85 | 85 | ->groupBy('institution_grades.id') |
86 | 86 | ->get(); |
87 | - }else{ |
|
87 | + }else { |
|
88 | 88 | return null; |
89 | 89 | } |
90 | 90 | } |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | * @param $year |
97 | 97 | * @param $id |
98 | 98 | */ |
99 | - public function updatePromoted($year, $id){ |
|
100 | - self::where('id',$id)->update(['promoted'=>$year]); |
|
99 | + public function updatePromoted($year, $id) { |
|
100 | + self::where('id', $id)->update(['promoted'=>$year]); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | * @param $gradeId |
108 | 108 | * @return mixed |
109 | 109 | */ |
110 | - public function getInstitutionGrade($institutionId, $gradeId){ |
|
111 | - return self::where('education_grade_id',$gradeId) |
|
112 | - ->where('institution_id',$institutionId)->get()->first(); |
|
110 | + public function getInstitutionGrade($institutionId, $gradeId) { |
|
111 | + return self::where('education_grade_id', $gradeId) |
|
112 | + ->where('institution_id', $institutionId)->get()->first(); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -117,14 +117,14 @@ discard block |
||
117 | 117 | * @param null $institution |
118 | 118 | * @return mixed |
119 | 119 | */ |
120 | - public function getInstitutionGradeToPromoted($year, $institution = null){ |
|
120 | + public function getInstitutionGradeToPromoted($year, $institution = null) { |
|
121 | 121 | return self::query() |
122 | - ->select('education_grades.name','institutions.code','institutions.name as institution_name','institution_grades.id','institution_grades.institution_id','institution_grades.education_grade_id') |
|
123 | - ->where('promoted','=',$year) |
|
124 | - ->join('education_grades','institution_grades.education_grade_id','=','education_grades.id') |
|
125 | - ->join('institutions', function($join) use ($year,$institution){ |
|
126 | - $join->on('institutions.id','=','institution_grades.institution_id') |
|
127 | - ->where('institutions.code','=',$institution); |
|
122 | + ->select('education_grades.name', 'institutions.code', 'institutions.name as institution_name', 'institution_grades.id', 'institution_grades.institution_id', 'institution_grades.education_grade_id') |
|
123 | + ->where('promoted', '=', $year) |
|
124 | + ->join('education_grades', 'institution_grades.education_grade_id', '=', 'education_grades.id') |
|
125 | + ->join('institutions', function($join) use ($year, $institution){ |
|
126 | + $join->on('institutions.id', '=', 'institution_grades.institution_id') |
|
127 | + ->where('institutions.code', '=', $institution); |
|
128 | 128 | }) |
129 | 129 | ->orderBy('institution_id') |
130 | 130 | ->groupBy('institution_grades.id') |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | * @param $year |
136 | 136 | * @return mixed |
137 | 137 | */ |
138 | - public function getInstitutionGradeList($year,$limit){ |
|
138 | + public function getInstitutionGradeList($year, $limit) { |
|
139 | 139 | return self::query() |
140 | - ->select('education_grades.name','institutions.code','institutions.name as institution_name','institution_grades.id','institution_grades.institution_id','institution_grades.education_grade_id') |
|
141 | - ->where('promoted','=',$year) |
|
142 | - ->join('education_grades','institution_grades.education_grade_id','=','education_grades.id') |
|
140 | + ->select('education_grades.name', 'institutions.code', 'institutions.name as institution_name', 'institution_grades.id', 'institution_grades.institution_id', 'institution_grades.education_grade_id') |
|
141 | + ->where('promoted', '=', $year) |
|
142 | + ->join('education_grades', 'institution_grades.education_grade_id', '=', 'education_grades.id') |
|
143 | 143 | ->join('institutions', function($join) use ($year){ |
144 | - $join->on('institutions.id','=','institution_grades.institution_id'); |
|
144 | + $join->on('institutions.id', '=', 'institution_grades.institution_id'); |
|
145 | 145 | }) |
146 | 146 | ->orderBy('institution_id') |
147 | 147 | ->groupBy('institutions.id') |
@@ -84,7 +84,7 @@ |
||
84 | 84 | ->where('institution_grades.institution_id', $institutionId) |
85 | 85 | ->groupBy('institution_grades.id') |
86 | 86 | ->get(); |
87 | - }else{ |
|
87 | + } else{ |
|
88 | 88 | return null; |
89 | 89 | } |
90 | 90 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | use Webpatser\Uuid\Uuid; |
7 | 7 | |
8 | -class Institution_class_grade extends Base_Model { |
|
8 | +class Institution_class_grade extends Base_Model { |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * The database table used by the model. |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough |
48 | 48 | */ |
49 | - public function educationSubject(){ |
|
50 | - return $this->hasManyThrough('App\Models\Education_grades_subject','App\Models\Institution_subject', |
|
51 | - 'education_subject_id' ,'education_subject_id'); |
|
49 | + public function educationSubject() { |
|
50 | + return $this->hasManyThrough('App\Models\Education_grades_subject', 'App\Models\Institution_subject', |
|
51 | + 'education_subject_id', 'education_subject_id'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | public static function boot() |
71 | 71 | { |
72 | 72 | parent::boot(); |
73 | - self::creating(function ($model) { |
|
73 | + self::creating(function($model) { |
|
74 | 74 | $model->id = (string) Uuid::generate(4); |
75 | 75 | }); |
76 | 76 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | /** |
80 | 80 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
81 | 81 | */ |
82 | - public function classes(){ |
|
83 | - return $this->belongsTo('App\Models\Institution_grade','institution_class_id','id'); |
|
82 | + public function classes() { |
|
83 | + return $this->belongsTo('App\Models\Institution_grade', 'institution_class_id', 'id'); |
|
84 | 84 | } |
85 | 85 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Area extends Model { |
|
7 | +class Area extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |