So I've ssh'd into Homestead and have run art storage:link. I can see the symlink has been created just fine.
Now, in one of my controllers I'm saving an uploaded file to storage like so...
$profile_photo = $request->file('profile_photo')->store('profile-photos');
This is saving the image in storage/app/profile-photos. Now, how do I go about viewing this image on the frontend, without using Blade?
Am I supposed to manually create a symlink every time I use a custom directory? I'd thought storing it in profile-photos would put it in storage/app/public/profile-photos so it could show up on the frontend.
If I were to do this however...
$profile_photo = $request->file('profile_photo')->store('public/profile-photos');
I can view it at example.com/storage/profile-photos/filename.png but since I'm saving the file path in the user table this saves it as "public/profile-photos/filename.png"
Am I missing something? Surely I wouldn't be doing a str_replace for public with storage before saving it in the database, right?
I'm just looking for the best way to let users upload photos, store them in storage, and then call them on the frontend (I'm using Vue entirely on the frontend). So I'd like to just be able to access these at URLs.