Can't load images in laravel blade files

让人想犯罪 __ 提交于 2019-12-13 17:19:50

问题


I've downloaded a template from here.

I want to design pages like that in laravel blade pages, I put css and js files in public folder and link blade files to them, and it works.

But I can't handle images, there isn't a folder for images in this template and I don't know how to load them in my blade pages.


回答1:


you can upload images on below path

storage/app/public/images

//this way you can use in your blade file   

<img src = "{{ asset('/images/YOUR_IMAGE.png') }}" />

but you need to run one command

php artisan storage:link

it will create a symlink from public/storage to storage/app/public




回答2:


please insert as below path and make link like that. try this.

<div class="hidden-xs" style="width:200px; height:auto; margin-left:-10px;">
   <img src="{{ asset('uploads/logos/myLogo.png') }}">
</div>

If not working... then check your App Url in /.env and restart your app server.

APP_URL=http://localhost

Happy coding~!:)



来源:https://stackoverflow.com/questions/53933123/cant-load-images-in-laravel-blade-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!