0

I want to retrieve images from database an display them in webpage directly, how can I make a path?
Here's my view

@foreach($dw as $ad)
<!-- single product -->
<div class="col-lg-4 col-md-6">
    <div class="single-product">
        {{-- {{$ad->image}} --}}
        <img class="img-fluid" src="{{($ad->image)}}" alt="">
        <div class="product-details">
            <h5>{{$ad->jobC}}</h5>
            <div class="price">
                <h6>{{$ad->jobtype}}</h6>
                <p>{{$ad->details}}</p>
            </div>
            <div class="prd-bottom"><a href="submitcv.html">Send Your CV</a></div>
        </div>
    </div>
</div>
@endforeach

Controller Method

public function jaa(Request $request)
{ 
    $de = diligent::all();
    $de->image = $request->image;
    return view('jobs')->with('dw', $de);
}

How can I display the image? I tried this and it only shows the file name

4
  • What is stored in your database? What does $ad->image contain, only the filename? Then just prepend the path to where the actual image is stored. Commented Sep 9, 2019 at 18:16
  • i stored image file in database Commented Sep 9, 2019 at 18:17
  • "i stored image file in database" You mean the complete "contents" of the image? Like in a blob field? Commented Sep 9, 2019 at 22:32
  • yes a blob field. Commented Sep 10, 2019 at 5:24

1 Answer 1

0

asset() - Generate a URL to an application asset.

<img class="img-fluid" src="{{ asset('images/' . $ad->image) }}" />

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.