Symbolic link does not work on Laravel

0

I'm trying to make a folder public within the Laravel storage directory, but I did not succeed. The folder being made public is in the path:

project/storage/app/images

Yes, outside the public . I've already tried to create symblink normally with:

php artisan storage:link

And even created the link symbolic, but still did not get the images.

Later I tried:

ls -l -s "project/storage/app/images" "project/public/"

Also unsuccessful.

    
asked by anonymous 17.10.2018 / 03:59

1 answer

0

When you create the link to your public storage, access to it becomes via <host_do_projeto>/storage/<nome_do_arquivo> , ie if you upload a file to your public storage as foo.txt , access to it will be through <seu_host>/storage/foo.txt , and the same thing for files in subfolders, such as <seu_host>/storage/bar/foo.txt . You can still use the asset() function to generate the file access link, for example echo asset('storage/foo.txt');

Try again, because php artisan storage:link creates access to the public directory, store your public access files in it with Laravel's own functions and access the way I mentioned it is the correct way to use this form of storage.

At documentation has it all in more detail and with other forms of storage.

    
18.10.2018 / 19:54