问题
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