0
votes

I have a Laravel API for my backend and Vue Cli 3 for my front end. I am trying to access images from storage/app/avatars - Laravel to my front end Vue. So far I've done php artisan storage:link and it created a shortcut folder to my public. I have this in my controller User Controller show function

User Controller show function:

enter image description here

Here is a return response from postman :

enter image description here

when I open the link either thru browser or postman i get response 404 not found :

enter image description here

1

1 Answers

0
votes

laravel Storage::url() user .env APP_URL to generate url

so you need to fix

in .env

APP_URL=localhost:8000

then run php artisan config:clear

ref link https://github.com/laravel/laravel/blob/6d082c81e5bf226dfa6d1dc030e69a225349f535/config/filesystems.php#L41

in this link you can see internally use of APP_URL