@extends('layouts.app')
@section('content')

{{--{{dd($users)}}--}}

<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-10">
            <div class="card">
                <div class="card-header">Registered Users</div>
                <table class="table table-striped table-hover">
                    <thead class="">
                    <tr>
                        @foreach($users->colNames as $colName )
                            <th>{{ $colName }}</th>
                        @endforeach
                        <th>id</th>
                        <th>nickname</th>
                        <th>email</th>
                        <th>role</th>
                        <th>created</th>
                        <th>updated</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach ( $users as $user)
                        {{--<div>--}}
                        <tr>
                            <td>{{ $user->id }} </td>
                            <td>{{ $user->nickname }} </td>
                            <td>{{ $user->email }} </td>
                            <td>{{ $user->role }} </td>
                            <td>{{ $user->updated_at }} </td>
                            <td>{{ $user->created_at }} </td>
                        </tr>
                    {{--</div>--}}
                    @endforeach

                </table>
            </div>
        </div>
    </div>
</div>

{{$users->links()}}
    @endsection