User.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. ];
  47. /**
  48. * The attributes that should be hidden for arrays.
  49. *
  50. * @var array
  51. */
  52. protected $hidden = [
  53. 'password', 'remember_token',
  54. ];
  55. /**
  56. * The attributes that should be cast to native types.
  57. *
  58. * @var array
  59. */
  60. protected $casts = [
  61. 'email_verified_at' => 'datetime',
  62. ];
  63. public function country_name()
  64. {
  65. return $this->belongsTo(Country::class, 'nationality', 'id');
  66. }
  67. public function department_name()
  68. {
  69. return $this->belongsTo('App\Models\Department', 'department');
  70. }
  71. public function university()
  72. {
  73. return $this->belongsTo('App\Models\University', 'university_id');
  74. }
  75. }