User.php 739 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App;
  3. use Tymon\JWTAuth\Contracts\JWTSubject;
  4. use Illuminate\Notifications\Notifiable;
  5. use Illuminate\Foundation\Auth\User as Authenticatable;
  6. class User extends Authenticatable implements JWTSubject # 这里别忘了加
  7. {
  8. use Notifiable;
  9. protected $table='admin_user';
  10. // Rest omitted for brevity
  11. /**
  12. * Get the identifier that will be stored in the subject claim of the JWT.
  13. *
  14. * @return mixed
  15. */
  16. public function getJWTIdentifier()
  17. {
  18. return $this->getKey();
  19. }
  20. /**
  21. * Return a key value array, containing any custom claims to be added to the JWT.
  22. *
  23. * @return array
  24. */
  25. public function getJWTCustomClaims()
  26. {
  27. return [];
  28. }
  29. }