Voyager: Images not loading in admin panel

Created on 30 Jan 2017  ·  37Comments  ·  Source: the-control-group/voyager

  • Laravel Version: 5.2.0
  • Voyager Version: latest
  • PHP Version: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

Just solved this:
Updated .env file:
APP_URL=http://localhost:8000

Fixed issue

All 37 comments

can you screenshot the error in browser console?

Please try to rebuild symlink again via

php artisan storage:link

There is no error, but the dashboard is empty. Nothing is shown.
On 30 Jan 2017 07:59, "uchsarath" notifications@github.com wrote:

can you screenshot the error in browser console?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/the-control-group/voyager/issues/650#issuecomment-275985848,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQOoTUneNBuqDDSXOHH99CBf2OrD26tQks5rXXxYgaJpZM4Lw_VN
.

Screenshot please

screencapture-eliteminds-co-admin-1485866905042
screencapture-eliteminds-co-admin-sliders-1485866976787

Did you tried what @uchsarath said?

Please try to rebuild symlink again via
php artisan storage:link

@basmaseyam can you inspect the Image Path:

www.domain.com/storage/app/public/image_name.extension

does the image exist in this storage/app/public?

I was having issues with my Avatar images not showing up I just added the app.url to the templates img src elements as such. {{ config( 'app.url' ) }}

<img src="{{ config( 'app.url' ) }}{{ $user_avatar }}" class="profile-img">

Hi I have the same problem: what to do?

issues

I also have problem with images. After uploading project on server images are broken. before upload images were in public_html/public/storage/... Now on server path looks like this public_html/storage/app/public/ (there is everything what was in storage folder before)

What i need to change to use previous path ?

@jac0b95 and @srz0201:

Did you tried what @uchsarath said?

Please try to rebuild symlink again via
php artisan storage:link

Closed due to missing response from author.

Please everyone else still have this issue, please let us know as many details as possible to help you out.

I installed on 5.4 with "tcg/voyager": "dev-release/v0.11-menu-update"
and get this issue.
Installing with dummydata, then it breaks reading all media files.
like this one: http://localhost/storage/users/default.png

I have tried php artisan storage:link

Uploading works. Then file is stored correcly.. It is just not served..
using php artisan serve

Suggestions?
SOLVED!

Just solved this:
Updated .env file:
APP_URL=http://localhost:8000

Fixed issue

And after the update in the .env you have to restart the server. Right?

Sure.. I maybe also cleared all cache.. Do not remember

Hello all,

Its still happening. When i upload an avatar for my admin user i get the following error.

schermafbeelding 2017-04-23 om 12 32 50

I am using Voyager on valet (i do not know if it serves Nginx or Apache). It could also be an admin view issue because http://johnnymast.dev/storage/users/April2017/cZKKRGnTpm9WELvzdgPB.jpg does exist while it trys to load http://johnnymast.dev/admin/storage/users/April2017/cZKKRGnTpm9WELvzdgPB.jpg

The same problem I have on my hosting
I solved this problem:

-Redirect the domain to the main directory

.htaccess

<IfModule mod_rewrite.c>
   RewriteEngine On 
   # enable symbolic links
   Options +FollowSymLinks
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

Next
Create file /public/symlink.php

<?php
$target = '../storage/app/public';
$link = 'storage';
symlink($target, $link);
?>

Call this file
domian.com/symlink.php
I can not access the console :(

I have not tested it yet but the images are working :)

i have the symlink already but not public/admin/storage

i have public/storage

@rocichy and @johnnymast, are you using shared hosting (godaddy, bluehost, etc.)? If so, did you upload the entire project under a public_html or wwwroot directory (so you have public_html/public/index.php)? If this is the case, you have your laravel install done wrong. In this instance, your .env file will be accessible at http://yourdomain.com/.env, which is horribly bad for security.

Please search for something like "laravel on shared hosting" for directions. In short, your public_html directory needs to BE your public directory (or a symlink to it at least). If you need further help (AFTER searching and trying yourself), you are welcome to join our slack chat and post in the #help channel.

it was my own bad, i had /admin/ in my app_url 🤦‍♂️ 🥇

Use :
URL::to("storage/uses/mypicture.png");
^_^

I'm still having this issue, it is storing assets in the public/storage/settings folder but only rendering them as /settings, omitting the /storage part

I solve the problem with rewrite config/filesystem.php

'url' => env('APP_URL').'/public/storage',

Guys, this issue has been closed since February. If you still have issues, please just open your own

@uchsarath Thanks for help :) I just run this command and every images showed up without any console error :)

  1. delete 'storage' shortcut folder from your project 'public' directory or folder
  2. re-create the symlink using this command : php artisan storage:link
  3. open 'filesystems.php' from config folder and change the following line
    for localhost
    'url' => env('APP_URL').'/WRITE YOUR PROJECT FOLDER NAME/public/storage',
    for live server
    'url' => env('APP_URL').'/public_html/public/storage',

I think this solution is works fine for all of voyager user. Thanks.

Hi, php artisan storage:link is not published default image, but created users directory in public/storage folder!!
Also, when i inspect my image path it shows me: public//storage/users/default.png Here // after public and i don't understand why it takes // ?? I didn't change that path!

@hiren004 public/storage/users/... is absolutely correct.
public//storage/users/default.png is a problem with your configuration.
Please follow the Laravel installation guide exactly.

@emptynick I've installed laravel perfectly and then installed voyager step by step. Don't know why this take double // !!

I have same problem. Any one can help me please to solve
I make symlink to public/storage and not solved yet.

For those encountered this issue, the actual problem message is Class 'finfo' not found
This is an optional php extension which can be activated in _php.ini_ configuration file for localhost webservers, or in cpanel like a _control panel's php options_ for remote servers like below in the image.

If you have a secure connection on remote as https, Voyager documented this on Using HTTPS on your site . So just remove the env('APP_URL') on filesystems.php or use blank in .envfor _url_

Cheers.
fileinfo_cpanel

Images are not showing in my admin panel but they are in frontend.

hello, i got the same problem as @basmaseyam
i tried all solutions in the top without any result plz help !
images are not displaying pllllz help !!

This has been closed for a year and a half now. Also, it's from a MUCH older version of the package. Significant changes have occurred since then.

If you're still having issues, regardless of whether they're similar to this or not, please open a new issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zzpwestlife picture zzpwestlife  ·  3Comments

winex01 picture winex01  ·  3Comments

wp-src picture wp-src  ·  3Comments

raoasifraza1 picture raoasifraza1  ·  3Comments

rayqiri picture rayqiri  ·  3Comments