I know that for a normal variable I can use something like {{ $vid->shares ? : '0' }} to show default information in Laravel 5.7 blade files.
Now I need to show image source, which I am doing like <img src="{{ url($vid->thumb_file) }}"> this works fine until I hit a empty value.
is there anything to avoid such case by adding a default fallback image URL? Or "if else" is only a better solution?
Something like {{ url($vid->thumb_file) ?: url('/images/video-thumbnail.png') }} which is not working.
$vid->thumb_file ? url($vid->thumb_file) : url('/images/video-thumbnail.png')<img src="{{ $vid->thumb_file ? url($vid->thumb_file) : url('/images/video-thumbnail.png') }}" alt="" class="img-fluid">