Skip to content

Commit cf125ad

Browse files
author
ahmadhuss
committed
refactor: Publicly we can access photos with following URL asset("storage/$product->photo")
1 parent 9183807 commit cf125ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

resources/views/index.blade.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
@foreach($allProducts as $product)
5353
<div class="col-lg-4 col-md-6 mb-4">
5454
<div class="card h-100">
55-
<a href="#"><img class="card-img-top" src="https://dummyimage.com/700x400/000/ccc.jpg" alt=""></a>
55+
<a href="#">
56+
<img class="card-img-top" src="{{ $product->photo ? asset("storage/$product->photo") : 'https://dummyimage.com/700x400/000/ccc.jpg' }}" alt="">
57+
</a>
5658
<div class="card-body">
5759
<h4 class="card-title">
5860
<a>{{ $product->name }}</a>

0 commit comments

Comments
 (0)