How to deal with private images in laravel 5?

后端 未结 4 1762
暖寄归人
暖寄归人 2020-12-14 10:32

I am new to Laravel and trying to store private images so that only authenticated users can access them. Firstly I stored images in Public/UserImages folder. But here all th

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-14 11:14

    It's really up to you. It'll need to be outside the public directory - I'd personally pick resources/uploads or storage/uploads, or store them off-server entirely using the cloud filesystem support.

    Whatever you pick, you'll need a route that fetches the file and passes it along to the user after first checking that they have access.

提交回复
热议问题