'datetime', 'password' => 'hashed', 'status' => UserStatus::class, ]; } public function getActivitylogOptions(): LogOptions { return LogOptions::defaults() ->logFillable() ->logExcept(['password']) ->logOnlyDirty() ->dontSubmitEmptyLogs(); } public function canAccessPanel(Panel $panel): bool { return match ($panel->getId()) { 'admin' => $this->hasRole('admin'), 'partner' => true, default => false, }; } public function getTenants(Panel $panel): Collection { return collect([$this]); } public function canAccessTenant(Model $tenant): bool { return $tenant->getKey() === $this->getKey(); } public function listings() { return $this->hasMany(\Modules\Listing\Models\Listing::class); } public function favoriteListings() { return $this->belongsToMany(\Modules\Listing\Models\Listing::class, 'favorite_listings') ->withTimestamps(); } public function favoriteSellers() { return $this->belongsToMany(self::class, 'favorite_sellers', 'user_id', 'seller_id') ->withTimestamps(); } public function favoriteSearches() { return $this->hasMany(FavoriteSearch::class); } public function canImpersonate(): bool { return $this->hasRole('admin'); } public function canBeImpersonated(): bool { return ! $this->hasRole('admin'); } public function getFilamentAvatarUrl(): ?string { return filled($this->avatar_url) ? Storage::disk('public')->url($this->avatar_url) : null; } }