Laravel profile photos show only sometimes - laravel

I have a profile photo set up in a std header like so
<img src="{{ Auth::user()->profile_photo_url }}" class="img-circle" alt="User Image" />
When I sign in and land on my dashboard page using this header everything works great.
When I route to any other screen using the same header the picture does not show.
If I inspect the img src I get the same img src from all screens wether the picture shows up or not.
Any insight would help.
<img src="storage/profile-photos/1715359786021735.png" class="user-image" alt="User Image">

Related

Avatar Not Showing Laravel

I'm working with laravel framework, I have to create a profile so I changed the table User created in the Auth.. all works perfectly. I also added a Picture for the Profile picture or Avatar in the User table.
I made a profile page Image are showing and even to my nav bar.
this is the code I used.. and it work in other pages.
<img src="img/avatar/{{Auth::user()->picture}}">
this one is for my logo image I put the {{URL::asset}} because it's not showing also in another pages
<img src="{{ URL::asset('img/weblogo.png') }}">
then it works perfectly in all pages
but when I try to use it in the image from my database, It won't work and said
<img src="{{ URL::asset('img/avatar/{{Auth::user()->picture}}') }}">
syntax error, unexpected '}', expecting ')'
in my view
but when I try this, it won't work with all the pages
<img src="img/avatar/{{Auth::user()->picture}}">
Set asset as below
<img src="{{ asset('img/avatar/'.Auth::user()->picture) }}">
Or if you want to use URL::asset then
<img src="{{ URL::asset('img/avatar/'.Auth::user()->picture) }}">
You don't need to use {{ again inside {{ }}
Change
<img src="{{ URL::asset('img/avatar/{{Auth::user()->picture}}') }}">
to
<img src="{{ URL::asset('img/avatar/'.Auth::user()->picture) }}">

laravel how to display pdf in any blade page

How can I display a PDF in a Laravel View like I can display a normal
image?
The code I am using to implement an image is:
<div class="u-img">
<img
src="image/{{ Auth::user()->photo_jpeg }}"
alt="profile"
/>
</div>
What options/HTML-tags can I use to display a PDF?

How to us html <img src> to display an image in laravel?

I am trying to src an image into my html. Using Laravel as a backend.
<img class="card-img-top" src="storage/app/public/photos/{{$photo}}" alt="Card image cap">
I have also used the system link command and tried,
<img class="card-img-top" src="storage/{{$photo}}" alt="Card image cap">
In the past this would have been sufficent however, when using Laravel this does not link the image.
Does Laravel not allow direct 'src' links, or am I messing up the 'src' file structure?
Laravel uses blade syntax, variables ($) need to be between {{ }} in order to output their value.
So give <img class="card-img-top" src="storage/app/public/photos/{{ $photo }}" alt="Card image cap"> a try :)
i think the simple call like
<img src="storage/image/{{$data->photo}}" alt="">
$data = result from foreach
photo = column in db.
Correct file path is:
src="storage/photos/{{photo}}"
It skips /app/public
src="{{ url('assets/img') }}/{{ $item->photo }}"
Works for me!

images displaying in a site is not looking responsive

we are using follwing code to display images in this site:
http://demo1.kidsdial.com/
you can see 4 images below "slideshow" images
but it's not looking responsive.
That means, in mobiles and tabs it's not arranged properly & in smaller screen monitors, it's not displaying properly.
What code changes do I have to do to make it responsive?
Try this:
<img alt="" src="...topoffers1.jpg" style="max-width: 23%;">
<img alt="" src="...topoffers2.jpg" style="max-width: 50%;">
<img alt="" src="...topoffers3.jpg" style="max-width: 23%;">
http://prntscr.com/6r4iaj
http://prntscr.com/6r4igz
http://prntscr.com/6r4ilv

anchor opening element on separate page not working?

I am trying to get my anchors of thumbnails to open to a different page but at the specific element. I don't think it is working as there is a jquery plugin on the page that the elements exist on and I can't find a way to target them. When you click on a image it opens on the first in the sequence but not on the image requested. How can this be solved?
Please see my page here http://i-n-t-e-l-l-i-g-e-n-t-s-i-a.com/melissafranklin.com/index.html
The href attribute of the <a> tag should match the src attribute of the <img> tag
Use this:
<a href="images/paintings/7copy.jpg">
<img src="images/paintings/7copy.jpg" alt="">
</a>
Instead of this:
<a href="paintings.html">
<img src="images/paintings/7copy.jpg" alt="">
</a>

Resources