User.php 1.1 KB

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