User.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Models\System;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Foundation\Auth\User as Authenticatable;
  5. use Illuminate\Notifications\Notifiable;
  6. use Laravel\Sanctum\HasApiTokens;
  7. use Spatie\Permission\Traits\HasRoles;
  8. class User extends Authenticatable
  9. {
  10. use HasApiTokens, HasRoles, HasFactory, Notifiable;
  11. protected $table = 'system_users';
  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. * Get the attributes that should be cast.
  33. *
  34. * @return array<string, string>
  35. */
  36. protected function casts(): array
  37. {
  38. return [
  39. 'email_verified_at' => 'datetime',
  40. 'password' => 'hashed',
  41. 'last_activity_at' => 'datetime'
  42. ];
  43. }
  44. }