-2

Hi i'm working on sell picture project. I want to secure image in public folder . I follow this way How to protect image from public view in Laravel 5?

Everything work fine. I just want to make sure in storage Path thier is no way to access with URL right? I put my image into storage/images not storage/app/public

If i storage link it will be effect to my private image or not thanks

TryHard
  • 299
  • 4
  • 19

1 Answers1

4

In Laravel the root of the webserver is the public directory and the entrypoint is public/index.php.

This means that you can access via web server everything under public directory (like javascript/css files and image assets).

The storage directory is one level up and there is no way to access it.

In the discussion you mention the url http://www.somedomainname.net/images/users/userImage.jpg refers to the file userImage.jpg under /your/document/root/laravel/app/public/images/users by default, so the storage directory is not even read.

Laravel, though, will let you link the storage/app/public directory inside the public/storage directory, using the command php artisan storage:link, but that's it.

Leonardo Rossi
  • 2,922
  • 2
  • 20
  • 28