I'm trying to call some images to some views but ther server doesn't send the images.
Here's how i call my images:
<img src="{{ asset('img/'.$vehicle->pic) }}" alt="{{ $vehicle->model }}">
My images are at:
This is what i response i get:
UPDATE 1
Here are the headers of a image:
Why is this happening?
Related
Hope you can clarify this issue:
I am trying to ad a favicon to my website in the head of my html layout, the link i am using is :
href="{{ asset('assets/public/images/favicon-32x32.png') }}"
I have my file in the following route:
backend/public/images/icon.png
the icon is not displaying on the web anyway, any idea about what can be the issue here?
thanks
as in laravel documentation
The asset function generates a URL for an asset using the current
scheme of the request (HTTP or HTTPS):
$url = asset('img/photo.jpg');
You can configure the asset URL host by setting the ASSET_URL variable
in your .env file. This can be useful if you host your assets on an
external service like Amazon S3:
// ASSET_URL=http://example.com/assets
$url = asset('img/photo.jpg'); // http://example.com/assets/img/photo.jpg
so if you use default ASSET_URL value in .env file and your favicon file in file structure like :
project_Folder/public/images/favicon.ico
so you need to make your link like
{{-- favicon --}}
<link rel="shortcut icon" href="{{ asset('images/favicon-32x32.png') }}">
am trying to display my images dynamically from laravel storage folder but it says images not found even though i can see the pictures adding up in the folder, i also tried php artisan link but nothing good
<v-btn flat v-on="on">
<div>
{{connectedUser.name }} {{ connectedUser.last_name }}
<v-avatar size="38px"">
<img :src="'http://api.sirh.test/storage/'+connectedUser.img" />
</v-avatar>
</div>
</v-btn>
Try this.
:src=‘getImage(connectedUser)’
getImage(connectedUser){
return /storage/ + connectedUser.img
}
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.
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
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~!:)
I created api for getting image from server and show user but when enter url in server shows (Sorry, the page you are looking for could not be found.)
notice: request work in localhost
Try below code :
<img alt="image name" src="{{ url('image/imagename.jpeg') }}" />
Try this to use public_path() function:
<img src="{{ public_path($IMAGE_PATH) }}">
I m facing strange issue in laravel.
on my local serve it is not accessing this image
http://localhost:8000/img/logo.png
but I can acess this image
http://localhost:8000/img/profile.png
mover over it is not show in code as well any ideas.
Try
<img src="{{ url('img/yourimage.png') }}" alt="">
It will grab the image from your project public folder. It will look like yourwebsite.com/img/yourimage.png and in local server it will look like
http://localhost:8000/img/yourimage.png
2nd Solution:
Try
{{ Html::image('yourimage.png') }}
in laravel there is a inbuilt function url() which is used to ge the path from the public folder of your project. So to show image in your view you can use:
<img src="{{ url('img/yourimage.png') }}" alt="No image found">