F
Filament2y ago
Gush

nav menu user photo

how do return user's photo_path to that nav bar icon i tried this in User model
class User extends Authenticatable implements FilamentUser, HasAvatar

public function canAccessFilament(): bool
{
return true;
}

public function getFilamentAvatarUrl(): ?string
{
return $this->photo_path;
}
class User extends Authenticatable implements FilamentUser, HasAvatar

public function canAccessFilament(): bool
{
return true;
}

public function getFilamentAvatarUrl(): ?string
{
return $this->photo_path;
}
2 Replies
Dennis Koch
Dennis Koch2y ago
Check the HTML source code. Photo path is probably not what you want. You want a URL
Gush
GushOP2y ago
yup here is the solution
public function getFilamentAvatarUrl(): ?string
{
return Storage::url($this->photo_path);
}
public function getFilamentAvatarUrl(): ?string
{
return Storage::url($this->photo_path);
}
Want results from more Discord servers?
Add your server