User.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. 'fio',
  19. 'phone',
  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. 'role',
  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. public function applications() {
  46. return $this->hasMany(Application::class);
  47. }
  48. }