To add user profile photos in Laravel Filament admin panel, follow the steps below:
1. Extend the HasAvatar trait in your user’s model.
class User extends Authenticatable implements FilamentUser, HasAvatar
{
}
2. Override the getFilamentAvatarUrl method in your user’s model
public function getFilamentAvatarUrl(): ?string
{
return $this->profile_image;
}
Replace “profile_image” with your database column name
CHECk MORE FROM FILAMENT.
3. If the above method returns null, filament will use ui-avatars.com
If you want to use other providers rather than ui-avatars.com, please refer to this part of docs.