How to access locally saved images front front end
Hey guys, so I have Vue front end and Laravel as a backend api, they're separate code bases.
I've managed to get image uploads working, but how can I access these on my front end which is a separate code base? I've seen something about storage link but not sure if that works for when the code bases are split?
In Your API responses, you need to return complete URIs for the images, and store them in storage/app/public (with a symlink to public/storage) or store them directly in the public folder.
That's how I'm storing it, they have the file_path of public/league-pictures, I have to append it on the frontend, remove the public and swap it for storage and they load!
@TheDeveloper you can use the url helper in an accessor method to generate the image URL; and furthermore, you automatically append it to the JSON representation of the Model.