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

php artisan storage:link uses absolute path #33441

Closed
guoyunhe opened this issue Jul 6, 2020 · 4 comments
Closed

php artisan storage:link uses absolute path #33441

guoyunhe opened this issue Jul 6, 2020 · 4 comments

Comments

@guoyunhe
Copy link

guoyunhe commented Jul 6, 2020

  • Laravel Version: 7.18.0
  • PHP Version: 7.4.5
  • Database Driver & Version: MySQL 5.7.29

After run php artisan storage:link, a symlink is created in public/storage. But it links to absolute path /home/guo/git/webdev/laravel-test/storage/app/public.

This has several disadvantages:

  1. When you move or rename the project folder, all links broke. You have to delete and recreate them.
  2. It cannot work with both local system and homestead virtual machine.
  3. You cannot add absolute symlink to version control.

You won't have all these issues with relative symlink ../storage/app/public.

@driesvints
Copy link
Member

Lots of people have been using this for years without a problem so I don't think we should be making any changes here.

@guoyunhe
Copy link
Author

guoyunhe commented Jul 6, 2020

It is just an improvement to make the existing feature even better. Lots people don't have issue doesn't mean a few people can be ignored?

@ahinkle
Copy link
Contributor

ahinkle commented Jul 6, 2020

Feel free to submit a PR for review or create a community package.

@siikamiika
Copy link

Also ran into this issue. Seems like it's already possible after #32457 if you install symfony/filesystem and run php artisan storage:link --relative.

At least with default storage directory it would be easier to just use ln -s ../storage/app/public/ public/storage instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants