暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

User.php 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. use Spatie\Permission\Traits\HasRoles;
  7. class User extends Authenticatable
  8. {
  9. use Notifiable, HasRoles;
  10. /**
  11. * The attributes that are mass assignable.
  12. *
  13. * @var array
  14. */
  15. protected $table = 'users';
  16. protected $fillable = [
  17. 'name',
  18. 'password',
  19. 'email',
  20. 'refferal_code'
  21. ];
  22. /**
  23. * The attributes that should be hidden for arrays.
  24. *
  25. * @var array
  26. */
  27. protected $hidden = [
  28. 'password',
  29. ];
  30. public $timestamps = false; //matiin created_at, updated_at
  31. /**
  32. * The attributes that should be cast to native types.
  33. *
  34. * @var array
  35. */
  36. protected $casts = [
  37. 'email_verified_at' => 'datetime',
  38. ];
  39. public function profile()
  40. {
  41. return $this->hasOne('App\Profile');
  42. }
  43. public function timeline()
  44. {
  45. return $this->hasMany('App\Model\Timeline');
  46. }
  47. // public function petugas()
  48. // {
  49. // return $this->belongsTo('App\Model\User\PetugasUnitDonorDarahUdds', 'id', 'user_login_id');
  50. // }
  51. // public function rumah_sakit()
  52. // {
  53. // return $this->belongsTo('App\Model\User\MasterRumahSakits', 'id', 'user_login_id');
  54. // }
  55. }