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 ?
Solution:Jump to solution
If the image should be publicly accessible you need to use
->disk('public')
and Storage::disk('public')->url($this->avatar)
11 Replies
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
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 assetsNo 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
What's the URL?
do you means by this ? sorry im still new in programming
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 usethis is my code . im using fileupload . do i need to check other things ?
->disk('public')
And where did it upload your file?
/storage/app
?Solution
If the image should be publicly accessible you need to use
->disk('public')
and Storage::disk('public')->url($this->avatar)
thanks . its worked!