Confusions about laravel storage directory and its symlink

Posted 1 year ago by tanmay_das

Okay, this is what I understand about the laravel storage so far:

All my public assets, things like profile pictures or any user-generated files should reside in myapp/storage/app/public and things that are not user-generated, but application-specific, such as: logo, banner etc., should reside outside the public directory. For instance, myapp/storage/app/private.

We create a symlink within the myapp/public/ directory that points to myapp/storage/app/public/ and we access our public assets by asset('storage/avatar.png'). It loads the avatar from myapp/storage/app/public/avatar.png

But how do I access my private assets? Say I want to load my logo.png file which is in myapp/storage/app/private/logo.png this path?

Please sign in or create an account to participate in this conversation.