MonsieurRado's avatar

Laravel8 User Image

Hello, I tried to install Laravel8 and I have an issue with the user image one the profile page. When I upload an image and save it, it doesnt show.

0 likes
15 replies
tykus's avatar

I had the same issue, the fully qualified domain was incorrect.

Does your domain and TLD match those in the APP_URL environment variable; Laravel 8 appears to use .test now, whereas I tend to use .dev still?

Snapey's avatar

What is the URL of the page that should show the avatar

Snapey's avatar
Snapey
Best Answer
Level 122

So your APP_URL should be http://127.0.0.1:8000

open tinker and enter

>>> User::find(1)->toArray()

what do you see? (use id for a user with valid image)

profile_photo_url is the path to the avatar

3 likes
MonsieurRado's avatar

it works thank you for you help Snapey!! I've found my mistake.

when you install laravel, the default App_URL is Localhost.

I tried to replace it with http://127.0.0.1:8000 and I did it wrong. It was set to: http:http://127.0.0.1:8000 (two times http)

Sorry for the disturbing and thanks you very much for your help Snapey and M_Viper28 !!

1 like
newbie360's avatar

just in case someone read this post later

you may have some problems when you install Laravel 8 with Jetstream

1. .env will append .test to your project name

when your use laravel new blog.test --jet

in .env APP_URL=http://blog.test.test

2. .env change the DB config

3. for Homestead

for example your host is Windows 10

and you create a new homestead, and ready vagrant up

vagrant ssh to where you want create the project and run

composer global require laravel/installer
laravel new project-name --jet

end of the installation, you will see an error about symlink,

in the host (Windows 10), run as Administrators to use cmd , create the symlink

mklink /J "D:\your\project\public\storage" "D:\your\project\storage\app\public"

and in host (Windows 10) go to project folder (NOT in the Homestead) run

npm install && npm run dev

4. Migration

vagrant ssh to Homestead project folder, run

php artisan migrate

Enjoy!

1 like
ghosstk's avatar

I had the same issue because I forgot the 'storage:link' command.

1 like
stur@iesebre.com's avatar

Setting .env with correct URL values and php artisan storage:link solves the problem for me.

1 like
azc99's avatar

having the same problem with profile-photos but cannot figure out the correct APP_URL path. Storage is linked to public/storage. In a fresh "laravel new l8 --jet", the default APP_URL=http://l8.test. I believe it used to be localhost or 127.0.0.1, same as DB_HOST. Using homestead macOS. Any input would be appreciated.

azc99's avatar

I finally got the photo-image to update. i deleted the public/storage directory in homestead and then ran the storage:link command again. a new symbolic link was created and voila!

To anyone having a similar issue using --jet and homestead.......

Please or to participate in this conversation.