我似乎无法控制自己想要的动作。如果第一张图片为空,我希望选择适当性别的占位符。
<div class="image-box">
<img src="{{config('url.media')}}u/{{ $agent['user_id'] }}/150@2x.jpg" style="width:100%" class="image_main" alt="">
@if(empty('image_main'))
@if($agent['gender'] == 'Mr')
<img src="{{('../assets/male-placeholder.png')}}" style="width:100%" alt="">
@elseif($agent['gender'] == 'Ms')
<img src="{{('../assets/female-placeholder.png')}}" style="width:100%" alt="">
@else($agent['gender'] == 'Mx')
<img src="{{('../assets/non-binary-placeholder.png')}}" style="width:100%" alt="">
@endif
@endif
</div>