User.php 922 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Contracts\Auth\MustVerifyEmail;
  4. use Illuminate\Foundation\Auth\User as Authenticatable;
  5. use Illuminate\Notifications\Notifiable;
  6. class User extends Authenticatable implements MustVerifyEmail
  7. {
  8. use Notifiable;
  9. /**
  10. * The attributes that are mass assignable.
  11. *
  12. * @var list<string>
  13. */
  14. protected $fillable = [
  15. 'name',
  16. 'email',
  17. 'password',
  18. 'role',
  19. ];
  20. /**
  21. * The attributes that should be hidden for serialization.
  22. *
  23. * @var list<string>
  24. */
  25. protected $hidden = [
  26. 'password',
  27. 'remember_token',
  28. ];
  29. /**
  30. * Get the attributes that should be cast.
  31. *
  32. * @return array<string, string>
  33. */
  34. protected function casts(): array
  35. {
  36. return [
  37. 'email_verified_at' => 'datetime',
  38. 'password' => 'hashed',
  39. ];
  40. }
  41. }