F
Filament3mo ago
Mingo

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
awcodes3mo 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
MingoOP3mo 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
awcodes3mo 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
MingoOP3mo 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
awcodes3mo 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
MingoOP3mo ago
ya ya that's right
awcodes
awcodes3mo ago
Is the Google avatar based on email or something similar? Or are you using it from something like socialite
Mingo
MingoOP3mo ago
yeah socialite
awcodes
awcodes3mo ago
Do you want Google authenticated users to be able to change their avatar?
Mingo
MingoOP3mo ago
No, the problem is that when I only change the username, the avatar field becomes null.
awcodes
awcodes3mo ago
Do you have the code in a repo you can share?
Mingo
MingoOP3mo ago
Or do I have to delete the avatar edit field? can i send it in dm?
awcodes
awcodes3mo ago
Sure
Want results from more Discord servers?
Add your server