Closed rohi1386 closed 5 years ago
` @foreach($users as $user)
<tr
<td class="text-center">{{$i}}</td>
<td>{{$user->name}}</td>
<td>{{$user->name}}</td>
<td>{{$user->email}}</td>
<td class="text-danger text-bold">{{$user->level}}</td>
**************@if($user->Active::users()) // ******************************
<td class="text-center">
<button type="button" class="btn btn-success btn-sm ">online</button>
</td>
@else
<td class="text-center">
<button type="button" class="btn btn-default btn-sm">offline</button>
</td>
@endif`
Sorry for the late response. I probably would just do Active::users()->contains()
or something similar. Active::users()
is a collection of Models, so you can just use collection methods to do what you need to do.
Hello How do I know if an online user is online or offline? For example, there are no methods such as isonline( ) or isactive( )? I now have a forech( ) of all my friends and I want to show everyone online. How're you?