User.php 982 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. const DEFAULT_SORT_BY = 'created_at';
  10. /**
  11. * The attributes that are mass assignable.
  12. *
  13. * @var list<string>
  14. */
  15. protected $fillable = [
  16. 'name',
  17. 'email',
  18. 'phone',
  19. 'password',
  20. 'role',
  21. ];
  22. /**
  23. * The attributes that should be hidden for serialization.
  24. *
  25. * @var list<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. ];
  42. }
  43. }