Hello.
There is a code that displays all the elements from the database, during the output checks for the presence of a value in the database:
<div class="tickets-places"> {{$i = 1}} @foreach($tickets as $t) @if($t->number != $i) <div class="one-place" id="game-place-{{$i}}" onclick="setplace(2,1, {{$i}}, {{$user->id}});"> <span>{{$i}}</span> </div> @else <div class="one-place" id="game-place-" onclick="setplace(2,1, {{$i}}, {{$user->id}});"> <span>test</span> </div> @endif {{$i = $i+1}} @endforeach </div> If the value is in the database, then displays test. It turns out that if @if works, then it changes the first elements or if the value of $t->number is set in two lines in the database, it still displays test only for the first value. How can this be solved?