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

Salim
  • 9,886
  • 5
  • 23
  • 55

2 Answers2

0

Try this

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

Make sure to symlink your storage folder as well

php artisan storage:link
Salim
  • 9,886
  • 5
  • 23
  • 55
0

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

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

dılo sürücü
  • 2,921
  • 1
  • 15
  • 24