The property or inmueble has several photos, I want to access these fotos, are these two the same?, in the second the query is execute every cycle of the loop? First Form
<?php $photos = $inmueble->photos; ?>
@foreach ($photos as $key => $photo)
<div class="photo-cont {{ ($key === 0) ? 'current' : ''; }}" >
<img src="{{ $photo->url }}" alt="russia">
</div>
@endforeach
Second form
@foreach ($inmueble->photos as $key => $photo)
<div class="photo-cont {{ ($key === 0) ? 'current' : ''; }}" >
<img src="{{ $photo->url }}" alt="russia">
</div>
@endforeach
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community