User.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Models;
  3. // use Illuminate\Contracts\Auth\MustVerifyEmail;
  4. use Illuminate\Database\Eloquent\Factories\HasFactory;
  5. use Illuminate\Foundation\Auth\User as Authenticatable;
  6. use Illuminate\Notifications\Notifiable;
  7. class User extends Authenticatable
  8. {
  9. /** @use HasFactory<\Database\Factories\UserFactory> */
  10. use HasFactory, Notifiable;
  11. /**
  12. * The attributes that are mass assignable.
  13. *
  14. * @var list<string>
  15. */
  16. protected $fillable = [
  17. 'login',
  18. 'phone',
  19. 'fio',
  20. 'email',
  21. 'password',
  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. public function applications() {
  45. return $this->hasMany(Application::class);
  46. }
  47. }