Hello I have these columns ‘name’, ’email’, ‘username’ and ‘ip’ how would I check or highlight table row in blade if records has same ip?
This is my controller
$promo = Promo::with(['participants' => function ($q) {
$q->orderBy('winner', 'desc')->orderBy('created_at', 'desc');
}])->find($id);
And this is my blade
@if($promos->participants->count() > 0)
@foreach($promos->participants as $participant)
<table>
<tr class="align-middle">
<td>Name</td>
<td>Email</td>
<td>Username</td>
<td>IP</td>
</tr>
<tr>
<td>{{$participant->name}}</td>
<td>{{$participant->email}}</td>
<td>{{$participant->username}}</td>
<td>{{$participant->ip}}</td>
</tr>
</table>
@endforeach
@endforeach
2
Answers
Do like this
In CSS you can add
Another way is to get duplicates by taking advantage of Larvel’s collection and have them passed in view.
So in your blade you would just need to check