storing and retrieving stored file in Laravel 5.4

Viewed 15655

A trivial scenario:

1) Symlink public/storage to storage/app/public using

php artisan storage:link

2) Upload file using

$path = $request->file('avatar')->store('avatars');

3) In my understanding, I should be able to access the file under this url - `www.example.com/storage/avatars/avatar.jpg

However, the path I get in the third step is actually public/avatars/avatar.jpg, so I end up replacing the 'public/' part with '' to have a correct path.

It seems that I am missing something, but I just can't find exactly what.

Thank you for your help!

1 Answers
Related