Voyager: Image not showing

Created on 2 Apr 2018  路  14Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.5.40
  • Voyager Version: 1.0.16
  • PHP Version: 7.2
  • Database Driver & Version:mysql 5.7.21
  • Valet-Linux
  • OS Ubuntu

Description:

if i enter link local to APP_URL then image not show

screenshot from 2018-04-03 00-20-30

but if i empty APP_URL then image show
screenshot from 2018-04-03 00-18-38

whats wrong
I've tried to change link to
project.apps
localhost
localhost:8000
http://localhost:8000
http://localhhost
but the result is the same picture does not appear

if it does not matter if I empty it APP_URL ??

question

Most helpful comment

@maxbgn, this has been solved/answered literally 1000 times in issues on this repo.

You've misunderstood the folder structure in Laravel. When you visit example.com, your webserver should be directing it to /path/to/laravel/public. Given this knowledge, why would you think example.com/storage/..... would point to /path/to/laravel/storage/... instead of /path/to/laravel/public/storage/...?

Also, you'll notice the url you access your site at differs from the generated url to your image (missing port number). The solution is to add the port number to your APP_URL

All 14 comments

What is the image source link for both condition ?

http://project.apps
same bro not show image @donmbelembe

@mysykez.... is this link for empty APP_URL or not?

@mysykez...What is the image source link for APP_URL: http://project.apps ?

@mysykez, sounds like your APP_URL is set to localhost, not http://localhost. Additionally, it should be your chosen domain, http://project.apps, not http://localhost

screenshot from 2018-04-09 09-36-21
http://project.apps/storage/posts/February2018/wwARlHcXqRZam8WvtG7r.jpg
work thanks . must use http:// hehehe

screenshot from 2018-04-09 09-33-14
this link http://localhost not work valet 404 - Not Found

thank u very much problem solved . thanks to @arafatrahman13
thanks for all his help

Laravel Version: 5.5
Voyager Version: 1.0
PHP Version: 7.1 + Apache
Hello, I am using Laragon and have the same issue with images. But I can not understand how to hadle with it. I navigate to http://myapp.test:8000/admin

default

The URL of that image is:
http://myapp.test/storage/users/April2018/0el2sSXGmvCe7yrgnh84.jpg
but when I navigate to laragon\www\myapp\storage, there is no folder named _users_ there.

default

The real physical path to a file is: laragon\www\myapp\storage\app\public\users\April2018\0el2sSXGmvCe7yrgnh84.jpg
In my .env file I have APP_URL=http://myapp.test
Please advice how to fix this issue.

UPD. I've changed APP_URL to http://myapp.test:8000 and that was the solution.

@maxbgn, this has been solved/answered literally 1000 times in issues on this repo.

You've misunderstood the folder structure in Laravel. When you visit example.com, your webserver should be directing it to /path/to/laravel/public. Given this knowledge, why would you think example.com/storage/..... would point to /path/to/laravel/storage/... instead of /path/to/laravel/public/storage/...?

Also, you'll notice the url you access your site at differs from the generated url to your image (missing port number). The solution is to add the port number to your APP_URL

This issue can be closed! The original question was answered and the answer of @maxbgn.

Quoting @maxbgn:

UPD. I've changed APP_URL to http://myapp.test:8000 and that was the solution.

Tags: question

APP_URL=http://localhost:8000/yourappname/public

That would lead to a security issue as you can access your .env file.

For everyone reading this: Don't do this

Was this page helpful?
0 / 5 - 0 ratings