I want to use Bootstrap carousel and the images should come from my database
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
@foreach($property->photos as $photo)
<div class="carousel-item">
<img class="d-block w-100" src="{{$photo->path}}" alt="First slide">
</div>
@endforeach
</div>
</div>
When I inspect the page I can see that the image is there, however I will not see anything of it because I need the class active in the div with class carousel-item.
Is there a way I can add the class active on the first box?
I tried using jQuery but it does not work:
$('.carousel-inner .carousel-item:first-child').addClass('active');