Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace App\Models;
  3. use Filament\Models\Contracts\FilamentUser;
  4. use Filament\Models\Contracts\HasAvatar;
  5. use Illuminate\Database\Eloquent\Factories\HasFactory;
  6. use Illuminate\Database\Eloquent\Relations\HasMany;
  7. use Illuminate\Foundation\Auth\User as Authenticatable;
  8. use Illuminate\Notifications\Notifiable;
  9. use Laravel\Fortify\TwoFactorAuthenticatable;
  10. use Laravel\Sanctum\HasApiTokens;
  11. use Wallo\FilamentCompanies\HasCompanies;
  12. use Wallo\FilamentCompanies\HasConnectedAccounts;
  13. use Wallo\FilamentCompanies\HasProfilePhoto;
  14. use Wallo\FilamentCompanies\SetsProfilePhotoFromUrl;
  15. class User extends Authenticatable implements FilamentUser, HasAvatar
  16. {
  17. use HasApiTokens;
  18. use HasFactory;
  19. use HasProfilePhoto;
  20. use HasCompanies;
  21. use HasConnectedAccounts;
  22. use Notifiable;
  23. use SetsProfilePhotoFromUrl;
  24. use TwoFactorAuthenticatable;
  25. public function canAccessFilament(): bool
  26. {
  27. return true;
  28. }
  29. public function getFilamentAvatarUrl(): ?string
  30. {
  31. return $this->profile_photo_url;
  32. }
  33. public function employeeships(): HasMany
  34. {
  35. return $this->hasMany(Employeeship::class);
  36. }
  37. /**
  38. * The attributes that are mass assignable.
  39. *
  40. * @var array<int, string>
  41. */
  42. protected $fillable = [
  43. 'name', 'email', 'password',
  44. ];
  45. /**
  46. * The attributes that should be hidden for serialization.
  47. *
  48. * @var array<int, string>
  49. */
  50. protected $hidden = [
  51. 'password',
  52. 'remember_token',
  53. 'two_factor_recovery_codes',
  54. 'two_factor_secret',
  55. ];
  56. /**
  57. * The attributes that should be cast.
  58. *
  59. * @var array<string, string>
  60. */
  61. protected $casts = [
  62. 'email_verified_at' => 'datetime',
  63. ];
  64. /**
  65. * The accessors to append to the model's array form.
  66. *
  67. * @var array<int, string>
  68. */
  69. protected $appends = [
  70. 'profile_photo_url',
  71. ];
  72. }