I have been getting an issue with Laravel and the Storage class.
I have create an upload form for users to control images used as logos in their account. I use Laravel File Storage inspired by Flysystem .
When I save an image, I proceed as follows :
// Store the logo in the public filesystem, and define a 'public' visibility
$logo = $request->file('logo')->store('logos/'.$account->id, 'public');
// Save the path in the database
$account->update([
'logo' => $logo
]);
The upload works fine, I can find the uploaded picture under the appropriate file structure : storage\app\public\logos\1\automatic-filename.jpeg
In my view, I retrieve the image url as follows :
<img src="{{ Storage::disk('public')->url($account->logo) }}" />
Which gives me the correct path :
http://www.example.com/storage/logos/1/automatic-filename.jpeg
But no matter what I try, I get a 403 on the image
Forbidden You don't have permission to access /storage/logos/1/automatic-filename.jpeg on this server.
I think I have done everything correctly :
I have created the symbolic link from public/storage to storage/app/public with
php artisan storage:linkuploaded files are saved on the server, with a 755 permission. All concerned folders have the same permissions.
I really don't know where to look...
If anyone ever got a similar issue, thanks in advance for your input !
Best regards,
Vlad