Laravel 5 - How to access image uploaded in storage within View?

前端 未结 12 2572
悲哀的现实
悲哀的现实 2020-11-22 14:05

I have got user\'s avatars uploaded in Laravel storage. How can I access them and render them in a view?

The server is pointing all requests to /public,

12条回答
  •  无人及你
    2020-11-22 14:29

    One option would be to create a symbolic link between a subfolder in your storage directory and public directory.

    For example

    ln -s /path/to/laravel/storage/avatars /path/to/laravel/public/avatars
    

    This is also the method used by Envoyer, a deployment manager built by Taylor Otwell, the developer of Laravel.

提交回复
热议问题