     
<div class="table-responsive">
<table id="orders" class="table custom-table">
    
        <thead>
            <tr>
                <th>Name</th>
                <th>Status</th>
            </tr>
        </thead>
        <tbody>
        @foreach($usersOnline as $user)
            <tr>
                <td>
                <div class="media-box">
                    <div class="media-box-body">
                        <a href="#" class="text-truncate">{{@strtoupper($user->name)}}</a><br>
                        @if($user->last_seen != null)

                            {{ \Carbon\Carbon::parse($user->last_seen)->diffForHumans() }} 
                            
                            @if(auth()->user()->role == "Administrator")
                             | <a href="ceqa-dashboard/users/view-profile/{{$user->id}}"> view profile </a>
                            @endif
                            @else
                                No data
                            @endif
                    </div>
                </div>
                </td>
                <td>
                @if(Cache::has('user-is-online-' . $user->id))
                <span class="text-success"><i class="icon-check-circle"></i> Online</span>
                @else
                <span class="text-danger"><i class="icon-x-circle"></i> Offline</span>
                @endif
                </td>
            </tr>
            @endforeach
        </tbody>
    </table>
</div>

