User.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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\Sanctum\HasApiTokens;
  8. //JWT
  9. use Tymon\JWTAuth\Contracts\JWTSubject;
  10. class User extends Authenticatable implements JWTSubject{
  11. use HasApiTokens, HasFactory, Notifiable;
  12. /**
  13. * The attributes that are mass assignable.
  14. *
  15. * @var array<int, string>
  16. */
  17. protected $fillable = [
  18. 'name',
  19. 'numero_empleado',
  20. 'rfc',
  21. 'fecha_ingreso',
  22. 'id_unidad_negocio',
  23. 'id_politica_vacaciones',
  24. 'role',
  25. 'isBlocked',
  26. 'email',
  27. 'password',
  28. 'estatus'
  29. ];
  30. /**
  31. * The attributes that should be hidden for serialization.
  32. *
  33. * @var array<int, string>
  34. */
  35. protected $hidden = [
  36. 'password',
  37. 'remember_token',
  38. ];
  39. /**
  40. * The attributes that should be cast.
  41. *
  42. * @var array<string, string>
  43. */
  44. protected $casts = [
  45. 'email_verified_at' => 'datetime',
  46. ];
  47. public function getJWTIdentifier(){
  48. return $this->getKey();
  49. }
  50. public function getJWTCustomClaims(){
  51. return [];
  52. }
  53. }