User.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace App\Models;
  3. use Tymon\JWTAuth\Contracts\JWTSubject;
  4. use Illuminate\Contracts\Auth\MustVerifyEmail;
  5. use Illuminate\Database\Eloquent\Factories\HasFactory;
  6. use Illuminate\Foundation\Auth\User as Authenticatable;
  7. use Illuminate\Notifications\Notifiable;
  8. class User extends Authenticatable implements JWTSubject
  9. {
  10. use HasFactory, Notifiable;
  11. protected $connection = 'mysql_app';
  12. /**
  13. * The attributes that are mass assignable.
  14. *
  15. * @var array
  16. */
  17. protected $fillable = [
  18. 'name',
  19. 'email',
  20. 'password',
  21. ];
  22. /**
  23. * The attributes that should be hidden for arrays.
  24. *
  25. * @var array
  26. */
  27. protected $hidden = [
  28. 'password',
  29. 'remember_token',
  30. ];
  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 getJWTIdentifier()
  40. {
  41. // TODO: Implement getJWTIdentifier() method.
  42. return $this->getKey();
  43. }
  44. public function getJWTCustomClaims()
  45. {
  46. // TODO: Implement getJWTCustomClaims() method.
  47. return [];
  48. }
  49. }