Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

spAo's avatar
Level 1

Add filter

Hello, I'm trying to add filter. I'm having students table and rounds table if student is added to rounds button appear but if student is not added to rounds button must be displayed

@if($student->rounds)
                         <th class="col-md-2 border-right"><span class="result btn btn-sm btn-primary col-md-1 edit-input"><span class="glyphicon glyphicon-edit"></span> </span></th>
                        @else
                      @endif

how can i do it with @if ?

0 likes
4 replies
MichalOravec's avatar
Level 75
@if ($student->rounds->isEmpty())
    // button
@endif
1 like

Please or to participate in this conversation.