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

IMAGES #5364

Closed
diegodeluca opened this issue Jun 11, 2021 · 9 comments
Closed

IMAGES #5364

diegodeluca opened this issue Jun 11, 2021 · 9 comments

Comments

@diegodeluca
Copy link

diegodeluca commented Jun 11, 2021

Version information

  • Laravel: v8.46.0
  • Voyager: v1.4.0
  • PHP: 7.4.5
  • Database: mysql

Description

Uploaded image not displaying
Profile image not showing

Steps To Reproduce

Steps to reproduce the behavior:

  1. laravel new myproject
  2. edited .env file
  3. composer require tcg/voyager
  4. php artisan voyager:install
  5. php artisan voyager:admin your@email.com --create (inserted name and password)
  6. php artisan serve
  7. Logged in: 127.0.0.1:8000/admin
  8. Uploaded an image in media section
  9. Image not displaying

Expected behavior

I expected to view the image in the media folder and as profile picture

Screenshots

Uploaded an image in media section
image

Additional context

@diegodeluca
Copy link
Author

I forgot: if I try to change the avatar profile I have the same issue

@diegodeluca
Copy link
Author

I detail my personal solution for a new project.

I think the images are uploaded in a "wrong" folder.
I didn't find the voyager default upload folder (TLDR), and because I'm starting a new project I applied an unconventional solution.

  1. removed the storage simlink in public folder (if present)
  2. in config\filesystems.php changed public_path('storage') => storage_path('app/public'), to public_path('storage') => storage_path('app'),
  3. launched php artisan storage:link

@fletch3555
Copy link
Collaborator

Just curious, but what's the reasoning behind changing the filesystem config (i.e. removing /public from the path)?

@diegodeluca
Copy link
Author

diegodeluca commented Jun 11, 2021

I've noticed that Voyager by default upload images inside storage/app but the symlink redirect to storage/app/public.
So I needed to modify the symlink and because I'm not so skilled and I don't know if it's possible to modify using CLI, I removed the symlink, modified the path in laravel settings and regenerated it.

My problem is that this package needs fixings to work but it's not explained how in the documentation. Even on a fresh new clean installation

@pro-cms
Copy link

pro-cms commented Jun 11, 2021

Hellow, simply go to filesystem , look at the local drive , update root path to app/public
i.e change from
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],

to
'local' => [
'driver' => 'local',
'root' => storage_path('app/public'),
],

your problem should be fixed

@MrCrayon
Copy link
Collaborator

This should be fixed with #5364, for existing installations you'll need to change disk configuration in config/voyager.php and set it as public.
You can read the explanation here: #5362

@diegodeluca
Copy link
Author

@pro-cms
Sorry for the late answer but only now I've had the possibility to try the solution and it worked.
Thank you

@pro-cms
Copy link

pro-cms commented Jul 10, 2021

@diegodeluca your always welcome

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants