Hi, good afternoon. Some time ago I did something similar but now it doesn't seem to work. I have two Laravel 5.8 projects. One is the web and the other is an Intranet from where I control various projects. So from the Intranet is where I insert news into the web project database. What I did was once I have my symbolic link on my intranet, I share it with the second project so that it can use them.
ln -s /var/www/intraPruebas/storage /var/www/Depildiodo/public/storage
This is the command I use in the terminal, and when I enter it cd/Depildiodo/public/storage/
I enter without problems. The problem is on the web that returns me error 404
when loading images.
In the file .conf
:
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
And in the view I print the images like this, as I have been doing normally:
background: url('{{ asset("{$item->foto}") }}
The route that returns the error is the following:
https://domino.com/storage/photos/1/Blog/blog3.jpg
What am I doing wrong? Some time ago I did it with the help of a colleague here, but now I can't find the solution
Your error was that the source path was not the correct one to create the symbolic link.
By default, the driver that Laravel uses for it
public disk
is thelocal
, which stores files instorage/app/public
.So the command should be executed like this: