I was with my local Laravel project, and I use this code to save my images:
$request->profile_photo->storeAs('empresas/perfil', $filename, 'public');
Now I have hosted my project, to host I had to get the folder public
from the project root, it is at the same project level and is called public_html
.
When saving an image, it displays the following error:
(1/1) ErrorException fopen (/ storage / ssd3 / 972/3511972 / public_html): failed to open stream: Is a directory in FilesystemAdapter.php (line 160) at HandleExceptions-> handleError (2, 'fopen (/ storage / ssd3 / 972/3511972 / public_html): failed to open stream: Is a directory' / '/ storage / ssd3 / 972/3511972 / laravel / vendor / laravel / ('File' = > '../companies/profile', 'file' => object (UploadedFile), 'name' => ' Laravel_foto_perfiliuyuiwayeatgmailcom_teste.jpg ',' options' => array ())) at fopen ('/ storage / ssd3 / 972/3511972 / public_html', 'r +') in FilesystemAdapter.php (line 160)
What do I need to change to fix the problem?