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