img src not working to showing Images Laravel 8 - laravel

i am beginner of Laravel 8. i creating simple project. but when i view the project images are not shown.
View Page
Index.php
<div>
<img src="{{asset('/images/chocolate-ice.jpg')}}" id="Chocolate" class="photo" width="100" height="100" data-toggle="modal" data-target="#exampleModal">
<b>Chocolate</b>
</div>
Folder structure

If you want to use Blade your template/view must end in .blade.php. That is how the view system knows what view engine to use. When it is just .php it does not use the Blade compiler to parse the template.

Related

Laravel and Vue: How do I get images from my public folder in a Vue component?

I am trying to get a logo image from my public folder in my laravel and Vue application. The file is called index.vue and have the following structure:
<template>
<div>
<div class="header-container">
<div class="header-content">
<div class="logo-container">
<img :src="'/public/images/logo/black.png'" alt="logo">
</div>
</div>
</div>
<!-- Tell Vue where to render components -->
<router-view></router-view>
</div>
</template>
Here is the file structure and you can see that file exists and the path is correct:
But when I switch back to the view it looks like this:
I have also tried to call it the way I would in a blade template using {{ asset() }}, but this doesn't work and gives me a compiler error.
How do I get this image to load in my Vue file?
Not sure about vue + laravel. But, since its a relative path I dont think you need to bind anything.
<img src="/images/logo/black.png" alt="logo">

vue/laravel images not showing (not found) using laravel storage folder

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
}

Can't load images in laravel blade files

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

jQuery carousel plugin, cycle2, not working in joomla 2.5 website

I'm trying to set up the jquery carousel plugin, cycle2, in joomla 2.5. I want a straightforward responsive carousel which will autostart and just run thru a series of pics on a loop on the introductory page in a joomla base website. I tried cycle2 out in a single page localhost website and it works well. But in joomla, it's not working. I've installed the 3 js files, jquery.cycle2.js, jquery.cycle2.tile.js and carousel.js in the template javascript folder and listed them in the template index.php folder, as I have done with a lot of other jquery code which running without any problems, so I'm puzzled as to why cycle2 doesn't work. Also, firebug shows that the cycle2 js files are not being loaded. I can't figure out why this is so. This is the html segment from the joomla page:
<div id="carousel">
<div class="cycle-slideshow responsive" data-cycle-timeout = "3500" data-cycle-speed = "1000 data-cycle-fx="tileBlind" data-cycle-tile-count=17>
<img src="/templates/beez_20/images/carousel/siti_rs_1.png" >
<img src="/templates/beez_20/images/carousel/siti_rs_2.png" >
<img src="/templates/beez_20/images/carousel/siti_rs_3.png" >
<img src="/templates/beez_20/images/carousel/siti_rs_4.png" >
<img src="/templates/beez_20/images/carousel/siti_rs_5.png" >
</div>
</div>
Any help would be welcome.

How to display images using codeigniter

am trying to display the images of my products in a shopping cart and this is the code am using to do that...
<img src=" <?php echo 'image/'. $product['picture']?>" /><br />
but the images do not show. I have stored the images in a folder called image outside applications.
You can use base_url to get full path without index.php.
Hope you images folder exist in project root folder.
<img src="<?php echo base_url('image/'. $product['picture']);?>" />

Resources