@@ -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 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'; |
@@ -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. |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class User_contact extends Base_Model { |
|
7 | +class User_contact extends Base_Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected $dates = ['modified', 'created']; |
43 | 43 | |
44 | - public static function createOrUpdate($data,$user){ |
|
44 | + public static function createOrUpdate($data, $user) { |
|
45 | 45 | |
46 | - if(!is_null($data['contact'])){ |
|
46 | + if (!is_null($data['contact'])) { |
|
47 | 47 | $exists = self::where('security_user_id', $data->id) |
48 | - ->where('value',$data['contact']) |
|
48 | + ->where('value', $data['contact']) |
|
49 | 49 | ->first(); |
50 | 50 | |
51 | - if(is_null($exists)){ |
|
51 | + if (is_null($exists)) { |
|
52 | 52 | $data = [ |
53 | 53 | 'security_user_id' => $data->id, |
54 | 54 | 'value' => $data['contact'], |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'preferred' => 1 |
59 | 59 | ]; |
60 | 60 | self::updateOrCreate($data); |
61 | - }else{ |
|
61 | + }else { |
|
62 | 62 | $exists = $exists->toArray(); |
63 | 63 | $exists['preferred'] = 1; |
64 | 64 | $exists['value'] = $data['contact']; |
@@ -58,7 +58,7 @@ |
||
58 | 58 | 'preferred' => 1 |
59 | 59 | ]; |
60 | 60 | self::updateOrCreate($data); |
61 | - }else{ |
|
61 | + } else{ |
|
62 | 62 | $exists = $exists->toArray(); |
63 | 63 | $exists['preferred'] = 1; |
64 | 64 | $exists['value'] = $data['contact']; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Upload extends Model { |
|
7 | +class Upload extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | |
44 | 44 | public $timestamps = true; |
45 | 45 | |
46 | - public function user(){ |
|
47 | - return $this->belongsTo('App\Models\Security_user','security_user_id'); |
|
46 | + public function user() { |
|
47 | + return $this->belongsTo('App\Models\Security_user', 'security_user_id'); |
|
48 | 48 | } |
49 | 49 | |
50 | - public function classRoom(){ |
|
51 | - return $this->belongsTo('App\Models\Institution_class','institution_class_id'); |
|
50 | + public function classRoom() { |
|
51 | + return $this->belongsTo('App\Models\Institution_class', 'institution_class_id'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Academic_period extends Base_Model { |
|
7 | +class Academic_period extends Base_Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected $dates = ['start_date', 'end_date', 'modified', 'created']; |
43 | 43 | |
44 | - public function getAcademicPeriod($year){ |
|
45 | - return self::query()->where('code',$year)->first(); |
|
44 | + public function getAcademicPeriod($year) { |
|
45 | + return self::query()->where('code', $year)->first(); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Identity_type extends Model { |
|
7 | +class Identity_type extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |