laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.34k stars 10.96k forks source link

Profile Image not Showing Laravel 8 jetstream #34319

Closed DikshantNiraula closed 4 years ago

DikshantNiraula commented 4 years ago

Description:

Hi, I created a laravel project after 1 day of Laravel 8 release, I was checking features of jetstream and everything works fine except when I change Image ot doesnot show up due to some reasons, found out that the url of image shows localhost instead of localhost:8000 { which showed image}, so my query is is there any where in file I can change so that I will see the image with url :8000( Already tried .env url) Thank you...

taylorotwell commented 4 years ago

Make your your .env APP_URL is correct and make sure to run php artisan storage:link.

DikshantNiraula commented 4 years ago

Tried it but no good.. linked storage file shows uploaded image but inspecting in browser shows localhost. will try with fresh laravel 8 files again..

janreycablinda commented 4 years ago

I have the same problem. is there any solution?

Sunny-Ojo commented 4 years ago

same problem here, and it makes the profile page ugly when it doesn't display. The image is currently in the storage folder though

DanielCruzCode commented 4 years ago

Hello, I delete the storage symbolic link in the public/ directory, and run php artisan storage:link, It works for me. Cache error?

I use php artisan view:clear , and doesn't works.

skino2019 commented 4 years ago

This issue is resolved my changing the APP_URL=http://sitename.test in your .ENV to what you have your domain parked as (Using Valet).

i use the .vm url so i changed mine to sitename.vm and my mugshot shows correctly.

DevRKYSona commented 4 years ago

Make your your .env APP_URL is correct and make sure to run php artisan storage:link.

Thanks! It worked for me.

DikshantNiraula commented 4 years ago

I made a fresh Laravel 8 folder and it worked smooth. Thank you everyone.

tomicato commented 4 years ago

skino2019 прав! Всё заработало прекрасно - лично для меня:

hamuelpalallos commented 3 years ago

Just delete or comment the APP_URL in .env, it should work just fine!

MonDc commented 3 years ago

After correction of APP_URL, run this :
php artisan optimize:clear

dariusdauskurdis commented 3 years ago

I had the same problem, my profile photo had wrong url http://**myproject.test/myproject.test**/storage/profile-photos/nf4U3SAgD8jAec1Q41lARqNxpSUSFUcPoBS5RQxG.jpeg Duplicated myproject.test APP_URL=myproject.test I changed to APP_URL=http://myproject.test and everything is ok now. Don't forget to add http://

suaveone commented 3 years ago

I solved this! If you use a virtual dev environment like Vagrant which I do. Your storage link might be linked to your local path and not your environment dev path. When I checked mines was linked to the local path. I was being careless and was not using my vagrant ssh. Once was in vagrant ssh I removed the storage link in public: rm -r public/storage and re added it with php artisan storage:link that fixed it. Im sure this issue can occur in other environments as well.

rscodelab commented 3 years ago

Set your APP_URL in .env , mine is APP_URL=http://localhost:8000 and run the command in CLI as php artisan storage:link to create the symbolic link for storage/app/public, if you haven't run the command you will not get the profile image in you dashboard.

ghost commented 3 years ago

First of all, check whether the slashes under:

config / jetstream.php

in line 44 (features) are still there. If so, then these must be deleted in order to activate this feature.

ausafmughal commented 3 years ago

@alexanderwerk your solution worked for me thank you.

Sunny-Ojo commented 3 years ago

Thank you all

On Thu, Feb 18, 2021, 11:30 PM Ausaf Liaquat notifications@github.com wrote:

@alexanderwerk https://github.com/alexanderwerk your solution worked for me thank you.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/laravel/framework/issues/34319#issuecomment-781677340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMLEVCUUMGM5VZXDHE7XRPTS7WIJHANCNFSM4RKV2OFQ .

tecbeez commented 3 years ago

@alexanderwerk it works for me. Thanks mate

arafkarim commented 3 years ago

I used 'php artisan view:clear' first and then 'php artisan storage:link' These work for me.

Jampire commented 3 years ago

While running Jetsream with Sail on Linux be sure to comment APP_URL and run sail artisan storage:link. It will run link command in the container, not on host machine. Or, you can run php artisan storage:link directly inside docker container.

Said20hr commented 2 years ago

This would help in case you are using jetstream and you run all :

And all what you get is an empty box for profile_photo_url, you need to verify that the attribute name is still exist on model User, otherwise you can custom the function defaultProfilePhotoUrl() from HasProfilePhoto trait, because it's returning the field name

solos10x commented 1 year ago

my profile photo was working fine but when i uploaded my website from the localhost to my webhost it stop working