Skip to content
Advertisement

Display a placeholder image for the bootstrap carousel when there are no images uploaded into the database using Laravel

I’ve been trying to use an if statement in my view which basically checks if the images in the carousel are null, however my if statement doesn’t seem to be working and I’m getting Trying to get property ‘images’ of non-object I’m not sure why it’s not returning the placeholder image. Is there something I’m doing wrong? Thank you.

View

JavaScript

Controller

JavaScript

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement