User.php 1.1 KB

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