User.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. class User extends Authenticatable
  9. {
  10. use HasApiTokens, HasFactory, Notifiable;
  11. protected $table = 'user';
  12. /**
  13. * The attributes that are mass assignable.
  14. *
  15. * @var array<int, string>
  16. */
  17. protected $fillable = [
  18. 'name',
  19. 'email',
  20. 'password',
  21. ];
  22. /**
  23. * The attributes that should be hidden for serialization.
  24. *
  25. * @var array<int, string>
  26. */
  27. protected $hidden = [
  28. 'password',
  29. 'remember_token',
  30. ];
  31. /**
  32. * The attributes that should be cast.
  33. *
  34. * @var array<string, string>
  35. */
  36. protected $casts = [
  37. 'email_verified_at' => 'datetime',
  38. ];
  39. public function test()
  40. {
  41. $this->createToken();
  42. $this->tokenCan();
  43. }
  44. }