Hello if there is no image selected I want to put a default one in its place, can someone tell me what I’m doing wrong here;
<?php if ($vehicle->images()->findBy("template", "cover")->isEmpty()) : ?>
<img class="card-img-top" src="<?= url('assets/images/noimage.jpg') ?>" alt="car image">
<?php else : ?>
<img class="card-img-top" src="<?= $vehicle->images()->findBy("template", "cover")->crop(520, 311, 80)->url() ?>" alt="Card image cap">
<?php endif ?>
Hello, can I not use the isEmpty after using findby?