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
No description
No description
13 Replies
awcodes
awcodes3w ago
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
Mingo
Mingo3w ago
Sorry, can't quite understand what you mean. Avatars will still appear when users upload a photo manually or are not login from Google.
awcodes
awcodes3w ago
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.
Mingo
Mingo3w ago
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.
awcodes
awcodes3w ago
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.
Mingo
Mingo3w ago
ya ya that's right
awcodes
awcodes3w ago
Is the Google avatar based on email or something similar? Or are you using it from something like socialite
Mingo
Mingo3w ago
yeah socialite
awcodes
awcodes3w ago
Do you want Google authenticated users to be able to change their avatar?
Mingo
Mingo3w ago
No, the problem is that when I only change the username, the avatar field becomes null.
awcodes
awcodes3w ago
Do you have the code in a repo you can share?
Mingo
Mingo3w ago
Or do I have to delete the avatar edit field? can i send it in dm?
awcodes
awcodes3w ago
Sure
Want results from more Discord servers?
Add your server