Laravel Spark Symlink for profile images does not work

I'm having trouble symbolically linking my storage directories in a new Spark installation. I checked the Spark docs ( found here ) and I tried to follow the instructions in the "Linking the repository directory section" section. But when I run the command

ln -s /storage/app/public /public/storage

I get the following error:

ln: failed to create symbolic link β€˜/public/storage’: No such file or directory.

This is strange because I checked through the command line and my editor, and the directory exists.

I also tried using

ln -sr /storage/app/public /public/storageas suggested here .

This created a symlink. But in my application, I still get 404 errors.

For more information that may help: I ​​use the Homestead development environment and I set up my project using the Spark installer. I also checked this other stack overflow question, but suggested that I take the same steps that I already tried.

Thanks for the help!

+4
source share
1 answer

Try ln -s $(pwd)/storage/app/public $(pwd)/public/storagefrom the project directory (the directory with composer.jsonin it). The team you are working with is trying to create a link from /storage...that is located in the root of the file system. You need to use the absolute path at startup ln, but you need to use the full path to your project. For example, in Homestead my way /home/vagrant/project-name/storage/app/public.

+4

All Articles