1 month ago

Show block via if else condition

Posted 1 month ago by papia91

If $block->user_username data empty show block button else run another if and else condition. But In foreach loop else not working @else Block2 Please anyone help me. Anyone know any other condition to do this things.

@else Block2 @endif this else condition stuck only if condition is working. if this @if(Auth::user()->name == $block->user_username && $user->username == $block->block_username) condition is false code is not showing else condition.

 @foreach($blocked as $block)    
                   @if(empty($block->user_username ))
                     <a href="#0" class="cd-popup-trigger">Block1</a>

                        @if(Auth::user()->username == $block->user_username and $user->username == $block->block_username)
                         <a href="#0" class="cd-popup-trigger">Unblock</a>
                            <a href="#0" class="cd-popup-trigger">Block2</a>

Please sign in or create an account to participate in this conversation.