I have problems with the storage link in Laravel8, everything was working correctly until I moved the project from localhost to hosting, it works with public_html and I have it structured as follows.
LaravelAPP
--app
--boostrap
--config
--database
--storage
--...
public_html
--img
--storage
-- .htaccess
-- index.php
-- ...
In localhost the public folder was inside the LaravelAPP folder but in the hosting I had to put its content in public_html.
This is the fragment of the function in which I save the documents, and it does it correctly, it saves them in the storage folder that is inside LaravelAPP but it does not do the same in public_html (I fear because it is not doing correctly the symbolic link).
$document->attach_image = $image->storeAs("public/image/$year/$user", $name_image);
$document->attach_pdf = $pdf->storeAs("public/pdf/$year/$user", $name_pdf);
When I save the image or pdf in the application I get the following URL, so it creates well the above code, but it shows me 404 | NOT FOUND because it is not created in public_html and can not show anything.
https://mydomain/storage/pdf/2022/darkvayder/pdf-test.pdf
I tried to add the following in the filesystems.php document, but it was not effective, I think the link to the public folder is still created.
'links' => [
public_path('public_html/storage') => storage_path('app/public'),
],