Voyager: Avatar is not working, showing broken images

Created on 26 Jun 2017  路  16Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.4.#
  • Voyager Version: 0.11.#
  • PHP Version: 7.1
  • Database Driver & Version:

Description:

issue1
issue2

I've just installed Voyager. And all images do not work.

Steps To Reproduce:

I updated .env file:
APP_URL=http://localhost:8000 and tried to change APP_URL run this php artisan storage:link but still not working.

Most helpful comment

I had the same problem. I have to change the APP_URL and clear config cache(php artisan config:cache). It works for me

All 16 comments

I ran into the same problem. What I had to do was go and delete the symlink in public/storage and make it again and it worked fine I have had to do that a few times. Next time it happens again ill pay more attention to see why it happens. Hope that works for you.

I had the same problem. I have to change the APP_URL and clear config cache(php artisan config:cache). It works for me

I tried to delete the symlink in public/storage and make it again, change the APP_URL, but it still does not work

Based on the problem I have, which is similar. I think the issue is on the server config maybe something with file permissions. what are you using to run the laravel project? Vagrant? Docker? Everything installed locally? Maybe try putting it on a server see if you get the same issue. For me it works locally all the time. But after I do a git pull on the server where I host the site it stops working and I have to delete and re link the file.

@jccpdev, with your issue, do you have the symlink committed to git? linux symlinks are specific to the environment they were created, so you shouldn't have them committed to source control,

@fletch3555 that is probably my problem, I will try that out tonight.

Suppose you are using la.adminlte.app as your ServerName in your httpd-vhosts.conf file like I do, then remember change the value of APP_URL from http://localhost to http://la.adminlte.app in your .env file. The real avatar path is actually public\storage\users\default.png.
image

APP_URL must point to your real host:

@Baumgarten2 = laravel.local for you NOT localhost:8000.
@wipflash @jccpdev find your real APP.URL

I have had the same problem using valet: it point do .dev in my case...

Hope this is usefull

@Baumgarten2, I'm assuming your issue was resolved by one of the above comments. If not, please let me know and we can get this reopened.

try to use
APP_URL=http://127.0.0.1:8000
instead of
APP_URL=http://localhost:8888

i have the some problem.changed APP_URL form http://localhost:8888 to http://127.0.0.1:8000 in .env file work for me

That is basically what our README says, yes.

I have solved this issue on MAMP server.
changed the .env file as
APP_URL=http://localhost:8888/voyager
(voyager is my app name)

Am having the same problem. am using laravel valet. My url is https://myAppName.app
The application is opening but the images are not showing

I found my solution. I was including '/public' when calling my images. like so {{ asset('/public/storage/'.$post->image) }}

instead of;
{{ asset('/storage/'.$post->image) }}

  1. delete storage short-link in public directory if it exists.
  2. remake a new link with artisan command (php artisan storage:link)
  3. confirm that the APP_URL={your domain}
  4. php artisan config:cache
  5. re-run the server

It worked for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TXRRNT picture TXRRNT  路  3Comments

raoasifraza1 picture raoasifraza1  路  3Comments

craigb88 picture craigb88  路  3Comments

winex01 picture winex01  路  3Comments

kevinjon27 picture kevinjon27  路  3Comments