Avatar On Top Bar Not Appear

Hi. i have an issue with avatar on top bar not appear . My file storage ,app url already being set properly . In UserResource . the image appeared at the table as you guys can see in the pics . is there anything that i missing to setup ?
No description
No description
No description
Solution:
If the image should be publicly accessible you need to use ->disk('public') and Storage::disk('public')->url($this->avatar)
Jump to solution
11 Replies
toeknee
toekneeβ€’4mo ago
It is not set correctly, otherwise it would load πŸ˜‰ dd on the avatar and see the result, can you access it? IF you can... it could be you are loading the asset over a domain not of the domain you are accessing it on
Dennis Koch
Dennis Kochβ€’4mo ago
Did you check the DevTools? Do you have a 404? What's the URL to the photo? You should probably use Storage::url() because asset() is for assets
Expecto Patronum
Expecto PatronumOPβ€’4mo ago
No i dont have that access but i already check in console . Its return 404 . Im not sure why . But the picture is saved Yess . I received 404 . Not sure why . Even im not using asset ( straight using return $this->avatar) also returns 404 too
Dennis Koch
Dennis Kochβ€’4mo ago
What's the URL?
Expecto Patronum
Expecto PatronumOPβ€’4mo ago
do you means by this ? sorry im still new in programming
No description
Dennis Koch
Dennis Kochβ€’4mo ago
And were did you save the actual image? Because you very likely didn't save it to /public Did you use a FileUpload? If yes: What's the code you use
Expecto Patronum
Expecto PatronumOPβ€’4mo ago
this is my code . im using fileupload . do i need to check other things ?
No description
toeknee
toekneeβ€’4mo ago
->disk('public')
Dennis Koch
Dennis Kochβ€’4mo ago
And where did it upload your file? /storage/app?
Solution
Dennis Koch
Dennis Kochβ€’4mo ago
If the image should be publicly accessible you need to use ->disk('public') and Storage::disk('public')->url($this->avatar)
Expecto Patronum
Expecto PatronumOPβ€’4mo ago
thanks . its worked!
Want results from more Discord servers?
Add your server