User.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. namespace App;
  3. use Illuminate\Contracts\Auth\MustVerifyEmail;
  4. use Illuminate\Foundation\Auth\User as Authenticatable;
  5. use Illuminate\Notifications\Notifiable;
  6. class User extends Authenticatable
  7. {
  8. use Notifiable;
  9. /**
  10. * The attributes that are mass assignable.
  11. *
  12. * @var array
  13. */
  14. protected $fillable = [
  15. 'first_name',
  16. 'last_name',
  17. 'name',
  18. 'nationality',
  19. 'dob',
  20. 'gender',
  21. 'email',
  22. 'password',
  23. 'phone_number',
  24. 'university_name',
  25. 'department',
  26. 'designation',
  27. 'uni_website',
  28. 'user_type',
  29. 'ref_no',
  30. 'others_department',
  31. 'is_education',
  32. 'is_publication',
  33. 'is_test_score',
  34. 'is_work_experience',
  35. 'admin_invite_id',
  36. 'is_available',
  37. 'status',
  38. 'apply_status',
  39. 'register_type',
  40. 'sign_up',
  41. 'remember_token',
  42. 'email_verification',
  43. 'email_verified_at',
  44. 'registered_date',
  45. 'invitation_date',
  46. 'last_logged_timezone',
  47. 'last_logged_at',
  48. ];
  49. /**
  50. * The attributes that should be hidden for arrays.
  51. *
  52. * @var array
  53. */
  54. protected $hidden = [
  55. 'password', 'remember_token',
  56. ];
  57. /**
  58. * The attributes that should be cast to native types.
  59. *
  60. * @var array
  61. */
  62. protected $casts = [
  63. 'email_verified_at' => 'datetime',
  64. ];
  65. public function country_name()
  66. {
  67. return $this->belongsTo(Country::class, 'nationality', 'id');
  68. }
  69. public function department_name()
  70. {
  71. return $this->belongsTo('App\Models\Department', 'department');
  72. }
  73. public function university()
  74. {
  75. return $this->belongsTo('App\Models\University', 'university_id');
  76. }
  77. public function wishlist_teacher()
  78. {
  79. return $this->belongsTo('App\User', 'wishlist_teacher_id','id');
  80. }
  81. }