User.php 1.0 KB

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