How to skip row number for particular row in php?

29 Views Asked by At

Here is the piece of the code, in which the counter variable is used to add the question number automatically. I want to skip the question number if the type==4(last category) which is the question heading.

 @php
                    $counter=0;
                    @endphp
                    @foreach($questions as $question)
                    <tr>
                        <td>{{++$counter}}</td>
                        <td colspan=4 style="text-align:left;">{{$question->title}}</td>
                    </tr>
                    <tr>
                        @if($question->type==1)
                        @include('partials.response',['question_no'=>$question->id,'question_title'=>$question->title])
                        @elseif($question->type==2)
                        @include('partials.attendance')
                        @elseif($question->type==3)
                        @include('par`enter code here`tials.rank')
                        @elseif($question->type==4)
                        @include('partials.question-heading')
                        
                  @endif

                    </tr>
                    @endforeach
0

There are 0 best solutions below