I am new to php and trying to use a php code in my local system. The code is working fine but its images and static files are not loading properly. when i tried to debug the issue i found that the correct image link in browser renders the login page of the program.
This is a strange scenario and i am not finding any solutions in any platform.
The urls i am trying are http://localhost:8000/image/banners/RG1.jpg
to access the public/image/banners directory.
I also have created a symlink and tried the url http://localhost:8000/storage/images/user/RG1.jpg
to access image stored in storage/app/public/images/user directory. This also generates the same result. The screenshot of the output is attached below.
output screenshot
I guess there is some poblem in middleware or routing.
4
Answers
you tried this command
for link folder
then use
make sure you’r working on the same port and also make sure you’ve done
php artisan storage:link
.second methode try accessing via the public folder
also try to delete the link that is made in the public folder and redo
php artisan storage:link
.and
php artisan optimize
.use
php artisan serve
and check.env
file.into
.env
file haveAPP_URL=localhost:8000
change toAPP_URL=127.0.0.1:8000
delete
/storage
in/public
directoryand try to
php artisan storage:link
please check the rewrite URL in htaccess files .
Here i saved images in the public folder , then images folder then image. Try the same way
.htaccess files inside public folder
Options -MultiViews -Indexes
then
php artisan optimize