User.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Contracts\Auth\MustVerifyEmail;
  4. use Illuminate\Database\Eloquent\Factories\HasFactory;
  5. use Illuminate\Foundation\Auth\User as Authenticatable;
  6. use Illuminate\Notifications\Notifiable;
  7. use Laravel\Fortify\TwoFactorAuthenticatable;
  8. use Laravel\Jetstream\HasProfilePhoto;
  9. use Laravel\Sanctum\HasApiTokens;
  10. class User extends Authenticatable
  11. {
  12. use HasApiTokens;
  13. use HasFactory;
  14. use HasProfilePhoto;
  15. use Notifiable;
  16. use TwoFactorAuthenticatable;
  17. /**
  18. * The attributes that are mass assignable.
  19. *
  20. * @var array
  21. */
  22. protected $fillable = [
  23. 'name',
  24. 'email',
  25. 'password',
  26. ];
  27. /**
  28. * The attributes that should be hidden for arrays.
  29. *
  30. * @var array
  31. */
  32. protected $hidden = [
  33. 'password',
  34. 'remember_token',
  35. 'two_factor_recovery_codes',
  36. 'two_factor_secret',
  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. /**
  47. * The accessors to append to the model's array form.
  48. *
  49. * @var array
  50. */
  51. protected $appends = [
  52. 'profile_photo_url',
  53. ];
  54. }