Voyager: Images not loading in admin panel in laravel voyager

Created on 12 Aug 2018  路  13Comments  路  Source: the-control-group/voyager

Version information

  • Laravel: v5.6
  • Voyager: latest
  • PHP: 5.6
  • Database Driver & Version:

Description


I have an issue in uploading and viewing images on admin panel. The admin panel avatar is not shown. Also when i upload an image it is not uploaded.

Steps To Reproduce

Most helpful comment

You asked for help, I'm telling you the solution. Telling me I'm wrong is not an appropriate response.

APP_URL plays no part in deciding whether the site will load. Its primary purpose is for generating absolute URLs (links, CSS/JS assets, and images), which is exactly the issue you're experiencing.

Instead of saying I'm wrong, why don't you just try it and see for yourself?

All 13 comments

5.6 is not a full Laravel version, and "latest" is not a valid Voyager version. Also, you provide no information about your issue other than "it doesn't work". Please update the version numbers, and in the future, put some effort into providing a detailed description of your issue, including things you've already tried in order to fix it.

Now, for your issue, we obviously need more information.... What is the URL you use to access Voyager? Also, what's the URL of one of the broken images?

thank you for your response ,
i'm working on the localhost ,
the images don't appear in all project
sans titre

Again, please provide the URLs I asked for, including port and path if applicable

sorry because i'm new in laravel voyager hh.please is that enough !
env

I understand you're new to Laravel, but what I asked for has nothing to do with Laravel.

What I need is the address in your browser's address bar when you see the images not loading (might be something like http://localhost:8000/admin).

I also need the src attribute of the image (img tag) that's not loading. You can get this with your browser's developer tools (right-click on the broken image then "Inspect" in most browsers)

the link in my browser is :
http://localhost:82/laravel/voyager/public/admin

the src img is :
Admin avatar

src

Port 82...? That's a very non-standard web port.

Either way, that's your problem. You have to include the port number in APP_URL. If you're accessing your site at http://localhost:82/, then that's what you set APP_URL to.

if the problem was from the url i will not be able to go into the app from the beginning , the issue is the images as this screenshot.
sans titre

You asked for help, I'm telling you the solution. Telling me I'm wrong is not an appropriate response.

APP_URL plays no part in deciding whether the site will load. Its primary purpose is for generating absolute URLs (links, CSS/JS assets, and images), which is exactly the issue you're experiencing.

Instead of saying I'm wrong, why don't you just try it and see for yourself?

thank you soooo much you are right it works

Thank you very much. Helped me here!! <3

When using Laragon, your URL is redirected in something like : http://projectname.test/ so don't forget to change it in env. at APP_URL=http://projectname.test

Thats pretty much exactly what @fletch3555 wrote above already.

Was this page helpful?
0 / 5 - 0 ratings