12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
-
- namespace App\Models;
-
- use Filament\Models\Contracts\FilamentUser;
- use Filament\Models\Contracts\HasAvatar;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Foundation\Auth\User as Authenticatable;
- use Illuminate\Notifications\Notifiable;
- use Laravel\Fortify\TwoFactorAuthenticatable;
- use Laravel\Sanctum\HasApiTokens;
- use Wallo\FilamentCompanies\HasCompanies;
- use Wallo\FilamentCompanies\HasConnectedAccounts;
- use Wallo\FilamentCompanies\HasProfilePhoto;
- use Wallo\FilamentCompanies\SetsProfilePhotoFromUrl;
-
- class User extends Authenticatable implements FilamentUser, HasAvatar
- {
- use HasApiTokens;
- use HasFactory;
- use HasProfilePhoto;
- use HasCompanies;
- use HasConnectedAccounts;
- use Notifiable;
- use SetsProfilePhotoFromUrl;
- use TwoFactorAuthenticatable;
-
- public function canAccessFilament(): bool
- {
- return true;
- }
-
- public function getFilamentAvatarUrl(): ?string
- {
- return $this->profile_photo_url;
- }
-
- /**
- * The attributes that are mass assignable.
- *
- * @var array<int, string>
- */
- protected $fillable = [
- 'name', 'email', 'password',
- ];
-
- /**
- * The attributes that should be hidden for serialization.
- *
- * @var array<int, string>
- */
- protected $hidden = [
- 'password',
- 'remember_token',
- 'two_factor_recovery_codes',
- 'two_factor_secret',
- ];
-
- /**
- * The attributes that should be cast.
- *
- * @var array<string, string>
- */
- protected $casts = [
- 'email_verified_at' => 'datetime',
- ];
-
- /**
- * The accessors to append to the model's array form.
- *
- * @var array<int, string>
- */
- protected $appends = [
- 'profile_photo_url',
- ];
- }
|