User.php 998 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App;
  3. use Illuminate\Contracts\Auth\MustVerifyEmail;
  4. use Illuminate\Notifications\Notifiable;
  5. use Illuminate\Foundation\Auth\User as Authenticatable;
  6. use Tymon\JWTAuth\Contracts\JWTSubject;
  7. use Illuminate\Database\Eloquent\SoftDeletes;
  8. use Spatie\Permission\Traits\HasRoles;
  9. class User extends Authenticatable implements JWTSubject
  10. {
  11. use Notifiable, HasRoles, SoftDeletes;
  12. /**
  13. * The attributes that are mass assignable.
  14. *
  15. * @var array
  16. */
  17. protected $fillable = [
  18. 'name',
  19. 'email',
  20. 'photo',
  21. 'type',
  22. 'password',
  23. 'position',
  24. 'phone',
  25. 'hire_date',
  26. 'is_active',
  27. ];
  28. /**
  29. * The attributes that should be hidden for arrays.
  30. *
  31. * @var array
  32. */
  33. protected $hidden = [
  34. 'password', 'remember_token',
  35. ];
  36. protected $dates = ['deleted_at'];
  37. public function getJWTIdentifier()
  38. {
  39. return $this->getKey();
  40. }
  41. public function getJWTCustomClaims()
  42. {
  43. return [];
  44. }
  45. }