User.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. ];
  31. /**
  32. * The attributes that should be hidden for arrays.
  33. *
  34. * @var array
  35. */
  36. protected $hidden = [
  37. 'password', 'remember_token',
  38. ];
  39. /**
  40. * The attributes that should be cast to native types.
  41. *
  42. * @var array
  43. */
  44. protected $casts = [
  45. 'email_verified_at' => 'datetime',
  46. ];
  47. public function country_name()
  48. {
  49. return $this->belongsTo(Country::class, 'nationality', 'id');
  50. }
  51. }