Laravel Access Images outside public folder

后端 未结 3 1296
借酒劲吻你
借酒劲吻你 2021-01-23 02:05

I need to store images in a backend for logged in users. The stored images need to be protected and not visible from the outside (public). I choosed a \"storage\" folder for thi

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-23 02:45

    Atimes you might have some images you do not wish to store in public directory for some various reasons.

    Although storing your images has lots of advantages.

    There are many ways you can achieve this, however I have this simple solution.

    You should create a helper class like so if already don't have one

    Then in your view (blade)

    @inject('helper', 'App\Services\Helper')
    
     
    

提交回复
热议问题