@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Security_group extends Model { |
|
7 | +class Security_group extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | // return $this->hasMany( User::class); |
46 | 46 | // } |
47 | 47 | |
48 | - public function security_users(){ |
|
49 | - return $this->belongsTo('App\Models\Security_group_user','security_group_id'); |
|
48 | + public function security_users() { |
|
49 | + return $this->belongsTo('App\Models\Security_group_user', 'security_group_id'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | - public function security_group_institution(){ |
|
54 | - return $this->hasMany('App\Models\Security_group_institution','security_group_id'); |
|
53 | + public function security_group_institution() { |
|
54 | + return $this->hasMany('App\Models\Security_group_institution', 'security_group_id'); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | use Webpatser\Uuid\Uuid; |
7 | 7 | |
8 | -class User_nationality extends Base_Model { |
|
8 | +class User_nationality extends Base_Model { |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * The database table used by the model. |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public static function boot() |
48 | 48 | { |
49 | 49 | parent::boot(); |
50 | - self::creating(function ($model) { |
|
50 | + self::creating(function($model) { |
|
51 | 51 | $model->id = (string) Uuid::generate(4); |
52 | 52 | }); |
53 | 53 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Area_administrative extends Model { |
|
7 | +class Area_administrative extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -42,7 +42,7 @@ |
||
42 | 42 | protected $dates = ['date_opened', 'date_closed', 'modified', 'created']; |
43 | 43 | |
44 | 44 | public function isActive($id){ |
45 | - return self::query()->find($id)->get()->first()->institution_status_id == 1; |
|
45 | + return self::query()->find($id)->get()->first()->institution_status_id == 1; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Institution extends Model { |
|
7 | +class Institution extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected $dates = ['date_opened', 'date_closed', 'modified', 'created']; |
43 | 43 | |
44 | - public function isActive($id){ |
|
44 | + public function isActive($id) { |
|
45 | 45 | return self::query()->find($id)->get()->first()->institution_status_id == 1; |
46 | 46 | } |
47 | 47 |
@@ -71,8 +71,8 @@ |
||
71 | 71 | |
72 | 72 | public function permissions(){ |
73 | 73 | return $this->hasMany('App\Models\Security_group_user','security_user_id','id') |
74 | - ->where('security_group_users.security_role_id','=',5) |
|
75 | - ->with(['security_group_institution','institution_staff','security_group' , 'staff_class','institution_group' , 'roles']); |
|
74 | + ->where('security_group_users.security_role_id','=',5) |
|
75 | + ->with(['security_group_institution','institution_staff','security_group' , 'staff_class','institution_group' , 'roles']); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | public function principal(){ |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | use Laravel\Passport\HasApiTokens; |
8 | 8 | |
9 | 9 | |
10 | -class User extends Authenticatable { |
|
10 | +class User extends Authenticatable { |
|
11 | 11 | |
12 | 12 | use HasApiTokens, Notifiable; |
13 | 13 | |
@@ -69,32 +69,32 @@ discard block |
||
69 | 69 | protected $dates = ['email_verified_at']; |
70 | 70 | |
71 | 71 | |
72 | - public function permissions(){ |
|
73 | - return $this->hasMany('App\Models\Security_group_user','security_user_id','id') |
|
74 | - ->where('security_group_users.security_role_id','=',5) |
|
75 | - ->with(['security_group_institution','institution_staff','security_group' , 'staff_class','institution_group' , 'roles']); |
|
72 | + public function permissions() { |
|
73 | + return $this->hasMany('App\Models\Security_group_user', 'security_user_id', 'id') |
|
74 | + ->where('security_group_users.security_role_id', '=', 5) |
|
75 | + ->with(['security_group_institution', 'institution_staff', 'security_group', 'staff_class', 'institution_group', 'roles']); |
|
76 | 76 | } |
77 | 77 | |
78 | - public function principal(){ |
|
79 | - return $this->hasMany('App\Models\Security_group_user','security_user_id','id') |
|
80 | - ->where('security_group_users.security_role_id','=',4) |
|
81 | - ->with(['security_group_institution','institution_staff','security_group' , 'staff_class','institution_group' , 'roles']); |
|
78 | + public function principal() { |
|
79 | + return $this->hasMany('App\Models\Security_group_user', 'security_user_id', 'id') |
|
80 | + ->where('security_group_users.security_role_id', '=', 4) |
|
81 | + ->with(['security_group_institution', 'institution_staff', 'security_group', 'staff_class', 'institution_group', 'roles']); |
|
82 | 82 | } |
83 | 83 | |
84 | - public function zonal_cordinator(){ |
|
85 | - return $this->hasMany('App\Models\Security_group_user','security_user_id','id') |
|
86 | - ->where('security_group_users.security_role_id','=',3) |
|
87 | - ->with(['security_group_institution','institution_staff','security_group' , 'staff_class','institution_group' , 'roles']); |
|
84 | + public function zonal_cordinator() { |
|
85 | + return $this->hasMany('App\Models\Security_group_user', 'security_user_id', 'id') |
|
86 | + ->where('security_group_users.security_role_id', '=', 3) |
|
87 | + ->with(['security_group_institution', 'institution_staff', 'security_group', 'staff_class', 'institution_group', 'roles']); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | |
91 | - public function institution_class_teacher(){ |
|
92 | - return $this->hasMany('App\Models\Institution_staff','staff_id','id') |
|
91 | + public function institution_class_teacher() { |
|
92 | + return $this->hasMany('App\Models\Institution_staff', 'staff_id', 'id') |
|
93 | 93 | ->with(['staff_class']); |
94 | 94 | } |
95 | 95 | |
96 | - public function teacher_classes(){ |
|
97 | - return $this->hasMany('App\Models\Institution_class','staff_id','id'); |
|
96 | + public function teacher_classes() { |
|
97 | + return $this->hasMany('App\Models\Institution_class', 'staff_id', 'id'); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | public function findForPassport($username) { |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Security_group_institution extends Model { |
|
7 | +class Security_group_institution extends Model { |
|
8 | 8 | |
9 | 9 | |
10 | 10 | /** |
@@ -44,16 +44,16 @@ discard block |
||
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | - public function institution(){ |
|
48 | - return $this->belongsTo('App\Models\Institution','institution_id'); |
|
47 | + public function institution() { |
|
48 | + return $this->belongsTo('App\Models\Institution', 'institution_id'); |
|
49 | 49 | } |
50 | 50 | |
51 | - public function institution_classes(){ |
|
52 | - return $this->hasMany('App\Models\Institution_class','institution_id','institution_id'); |
|
51 | + public function institution_classes() { |
|
52 | + return $this->hasMany('App\Models\Institution_class', 'institution_id', 'institution_id'); |
|
53 | 53 | } |
54 | 54 | |
55 | - public function security_group(){ |
|
56 | - return $this->belongsTo('App\Models\Security_group','security_group_id'); |
|
55 | + public function security_group() { |
|
56 | + return $this->belongsTo('App\Models\Security_group', 'security_group_id'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | } |
60 | 60 | \ No newline at end of file |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Import_mapping extends Model { |
|
7 | +class Import_mapping extends Model { |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * The database table used by the model. |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | protected $dates = []; |
43 | 43 | |
44 | 44 | |
45 | - public static function getSheetColumns($model = null){ |
|
45 | + public static function getSheetColumns($model = null) { |
|
46 | 46 | $columns = Import_mapping::where('model', '=', $model) |
47 | 47 | ->orderBy('order') |
48 | 48 | ->get()->toArray(); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | use Illuminate\Database\Eloquent\Model; |
8 | 8 | |
9 | 9 | |
10 | -class Education_programmes_next_programme extends Model { |
|
10 | +class Education_programmes_next_programme extends Model { |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * The database table used by the model. |
@@ -45,8 +45,8 @@ |
||
45 | 45 | public function build() |
46 | 46 | { |
47 | 47 | return $this->view('emails.mail') |
48 | - ->from($this->from_address,$this->from_name) |
|
49 | - ->to($this->user->email) |
|
48 | + ->from($this->from_address,$this->from_name) |
|
49 | + ->to($this->user->email) |
|
50 | 50 | ->subject($this->subject) |
51 | 51 | ->with($this->with); |
52 | 52 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $institution = Institution_class::find($file['institution_class_id']); |
25 | 25 | |
26 | 26 | $this->user = User::find($file['security_user_id']); |
27 | - $this->subject = 'SIS Bulk upload: '. $file['subject'] .$institution->institution->code.': '. $institution->name.' ' . date('Y:m:d H:i:s'); |
|
27 | + $this->subject = 'SIS Bulk upload: '.$file['subject'].$institution->institution->code.': '.$institution->name.' '.date('Y:m:d H:i:s'); |
|
28 | 28 | $this->from_address = env('MAIL_FROM_ADDRESS'); |
29 | 29 | $this->from_name = 'SIS Bulk Uploader'; |
30 | 30 | $this->with = [ |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function build() |
46 | 46 | { |
47 | 47 | return $this->view('emails.mail') |
48 | - ->from($this->from_address,$this->from_name) |
|
48 | + ->from($this->from_address, $this->from_name) |
|
49 | 49 | ->to($this->user->email) |
50 | 50 | ->subject($this->subject) |
51 | 51 | ->with($this->with); |