Can't load images in laravel blade files

2019-08-09 02:06发布

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.

2条回答
Animai°情兽
2楼-- · 2019-08-09 02:17

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~!:)

查看更多
做个烂人
3楼-- · 2019-08-09 02:41

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

查看更多
登录 后发表回答