Reputation: 131
I would like to display columns if it has value. Some columns has values some of them don't.
I wrote below code. but it didn't work. Could you teach me how to write code please?
@php
if(!empty($image->wc)){
echo "WC is ";
}
@endphp
{{ $image->wc }}
@php2
if(!empty($image->w_type)){
echo "W Type is :";
}
@endphp2
{{ $image->w_type }}
Upvotes: 1
Views: 121
Reputation: 5270
You can try this
@if(isset($image->wc))
echo "WC is".{{$image->wc}};
@endif
Upvotes: 1