Avatar from google not showing in edit form
hello guys i want to ask,
I took the avatar according to what is in each google account, how do I display the avatar in the edit form?
then, for example, if you only edit the name, it becomes a null avatar field
Thanks
13 Replies
Seems like you are trying to use the filament avatar instead of storing the avatar on the user model and telling filament to use that. https://filamentphp.com/docs/3.x/panels/users#setting-up-user-avatars
Sorry, can't quite understand what you mean.
Avatars will still appear when users upload a photo manually or are not login from Google.
If the avatar isn’t stored on the user model then it’ll never be shown in a form for the user. So you have to save the image to the user model. Then if you want it reflected in the filament panel’s user menu you need to tell filament where to get that image from. Hence the example I linked.
Oh yes, I have stored on the User Model but the value is a URL if login via google.
and I have tried the link you referenced.
Ah, ok I get it now. The problem is that the FileUpload field is expecting a path since it’s resolved via laravels storage facade. So a full url isn’t going to work with file upload.
ya ya that's right
Is the Google avatar based on email or something similar?
Or are you using it from something like socialite
yeah socialite
Do you want Google authenticated users to be able to change their avatar?
No, the problem is that when I only change the username, the avatar field becomes null.
Do you have the code in a repo you can share?
Or do I have to delete the avatar edit field?
can i send it in dm?
Sure