Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar is not working, showing broken images #1397

Closed
Baumgarten2 opened this issue Jun 26, 2017 · 16 comments
Closed

Avatar is not working, showing broken images #1397

Baumgarten2 opened this issue Jun 26, 2017 · 16 comments

Comments

@Baumgarten2
Copy link

  • 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.

@jccpdev
Copy link

jccpdev commented Jun 27, 2017

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.

@san3jaya
Copy link

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

@Baumgarten2
Copy link
Author

Baumgarten2 commented Jun 29, 2017

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

@jccpdev
Copy link

jccpdev commented Jun 30, 2017

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.

@fletch3555
Copy link
Collaborator

@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,

@jccpdev
Copy link

jccpdev commented Jun 30, 2017

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

@JKChen
Copy link

JKChen commented Jul 6, 2017

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

@max-bertinetti
Copy link

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 <project.name>.dev in my case...

Hope this is usefull

@fletch3555
Copy link
Collaborator

@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.

@MN-dev
Copy link

MN-dev commented Aug 25, 2017

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

@omer-jan
Copy link

omer-jan commented May 3, 2018

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

@emptynick
Copy link
Collaborator

That is basically what our README says, yes.

@ravigunz
Copy link

ravigunz commented Aug 2, 2018

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

@nanadjei
Copy link

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

@nanadjei
Copy link

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) }}

@Jihun0109
Copy link

Jihun0109 commented Mar 9, 2020

  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.

@thedevdojo thedevdojo locked and limited conversation to collaborators Mar 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests