moe-lk /
auth_app
| 1 | <?php |
||
| 2 | |||
| 3 | namespace App; |
||
| 4 | |||
| 5 | use Laravel\Passport\HasApiTokens; |
||
| 6 | use Illuminate\Notifications\Notifiable; |
||
| 7 | use Illuminate\Foundation\Auth\User as Authenticatable; |
||
| 8 | |||
| 9 | class User extends Authenticatable |
||
| 10 | { |
||
| 11 | use HasApiTokens, Notifiable; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 12 | |||
| 13 | public const CREATED_AT = 'created'; |
||
| 14 | public const UPDATED_AT = 'modified'; |
||
| 15 | /** |
||
| 16 | * The database table used by the model. |
||
| 17 | * |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | |||
| 21 | public $timestamps = true; |
||
| 22 | |||
| 23 | protected $table = 'security_users'; |
||
| 24 | |||
| 25 | |||
| 26 | |||
| 27 | /** |
||
| 28 | * Attributes that should be mass-assignable. |
||
| 29 | * |
||
| 30 | * @var array |
||
| 31 | */ |
||
| 32 | protected $fillable = [ |
||
| 33 | 'openemis_no', |
||
| 34 | 'first_name', |
||
| 35 | 'last_name', |
||
| 36 | 'address', |
||
| 37 | 'address_area_id', |
||
| 38 | 'birthplace_area_id', |
||
| 39 | 'gender_id', |
||
| 40 | 'remember_token', |
||
| 41 | 'date_of_birth', |
||
| 42 | 'nationality_id', |
||
| 43 | 'identity_type_id', |
||
| 44 | 'identity_number', |
||
| 45 | 'is_student', |
||
| 46 | 'modified_user_id', |
||
| 47 | 'modified', |
||
| 48 | 'created_user_id', |
||
| 49 | 'created', |
||
| 50 | 'username', |
||
| 51 | 'password', |
||
| 52 | ]; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * The attributes excluded from the model's JSON form. |
||
| 56 | * |
||
| 57 | * @var array |
||
| 58 | */ |
||
| 59 | protected $hidden = [ |
||
| 60 | 'password', |
||
| 61 | 'modified_user_id', |
||
| 62 | 'middle_name', |
||
| 63 | 'third_name', |
||
| 64 | 'modified', |
||
| 65 | 'created_user_id', |
||
| 66 | 'created' |
||
| 67 | |||
| 68 | ]; |
||
| 69 | |||
| 70 | |||
| 71 | |||
| 72 | |||
| 73 | /** |
||
| 74 | * The attributes that should be casted to native types. |
||
| 75 | * |
||
| 76 | * @var array |
||
| 77 | */ |
||
| 78 | protected $casts = []; |
||
| 79 | |||
| 80 | public function institutionStudents() |
||
| 81 | { |
||
| 82 | return $this->hasOne(Institution_student::class, 'student_id'); |
||
|
0 ignored issues
–
show
The type
App\Institution_student was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 83 | } |
||
| 84 | |||
| 85 | public function institutionStudentsClass() |
||
| 86 | { |
||
| 87 | return $this->hasOne(Institution_student::class, 'student_id'); |
||
| 88 | } |
||
| 89 | |||
| 90 | /** |
||
| 91 | * The attributes that should be mutated to dates. |
||
| 92 | * |
||
| 93 | * @var array |
||
| 94 | */ |
||
| 95 | protected $dates = ['date_of_birth', 'date_of_death', 'last_login', 'modified', 'created']; |
||
| 96 | |||
| 97 | public function rules() |
||
| 98 | { |
||
| 99 | return [ |
||
| 100 | 'identity_number' => [ |
||
| 101 | 'required', |
||
| 102 | 'unique:security_users,identity_number', |
||
| 103 | ] |
||
| 104 | ]; |
||
| 105 | } |
||
| 106 | |||
| 107 | public function getAuthPassword() |
||
| 108 | { |
||
| 109 | return $this->password; |
||
|
0 ignored issues
–
show
|
|||
| 110 | } |
||
| 111 | |||
| 112 | public function uploads() |
||
| 113 | { |
||
| 114 | return $this->hasMany('App\Models\Upload'); |
||
| 115 | } |
||
| 116 | |||
| 117 | public function class() |
||
| 118 | { |
||
| 119 | return $this->belongsTo('App\Institution_class_student', 'id', 'student_id'); |
||
| 120 | } |
||
| 121 | |||
| 122 | public function principal(){ |
||
| 123 | return $this->hasMany('App\Security_group_user','security_user_id','id') |
||
| 124 | ->where('security_group_users.security_role_id','=',4) |
||
| 125 | ->with(['security_group_institution','institution_staff','security_group' , 'staff_class','institution_group' , 'roles']); |
||
| 126 | } |
||
| 127 | |||
| 128 | public function zonal_cordinator(){ |
||
| 129 | |||
| 130 | return $this->hasMany('App\Security_group_user','security_user_id','id') |
||
| 131 | ->where('security_group_users.security_role_id','=',14) |
||
| 132 | ->with(['security_group_institution','institution_staff','security_group' , 'staff_class','institution_group' , 'roles']); |
||
| 133 | } |
||
| 134 | |||
| 135 | public function provincial_cordinator(){ |
||
| 136 | |||
| 137 | return $this->hasMany('App\Security_group_user','security_user_id','id') |
||
| 138 | ->where('security_group_users.security_role_id','=',13) |
||
| 139 | ->with(['security_group_institution','institution_staff','security_group' , 'staff_class','institution_group' , 'roles']); |
||
| 140 | } |
||
| 141 | } |
||
| 142 |