User.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. 'color',
  23. ];
  24. /**
  25. * The attributes that should be hidden for serialization.
  26. *
  27. * @var list<string>
  28. */
  29. protected $hidden = [
  30. 'password',
  31. 'remember_token',
  32. ];
  33. /**
  34. * Get the attributes that should be cast.
  35. *
  36. * @return array<string, string>
  37. */
  38. protected function casts(): array
  39. {
  40. return [
  41. 'email_verified_at' => 'datetime',
  42. 'password' => 'hashed',
  43. ];
  44. }
  45. }