I'm using laravel 5.6 for APIs and for frontend I'm using angular 4.4.
there is a concern for the files accessibility. public folder is used to store files. now I want to restrict files from being accessed publicly. I want to give access of the files to the authenticated users only.
tried to create a folder inside storage/app named uploads and put an image but it was accessible globally too.
I have been trying to find a proper solution since a day but not found anything yet.
There are some suggestions to use response->file($file)
and response->download($file)
but I need to return it in json response.
There are similar questions asked but not found helpful answer yet.
Please suggest a way to implement this, may help others like me who have been struggling to find a way out of this. How can I do this?