<div class="" id="result">
    <table class="table">
        <thead>
            <tr>
                <th>Id</th>
                <th>User name</th>
                <th>Attribute</th>
                <th>OP</th>
                <th>Value</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
            @foreach ($users as $item)
                <tr>
                    <td>{{$item->id}}</td>
                    <td>{{$item->username}}</td>
                    <td>{{$item->attribute}}</td>
                    <td>@if ($item->op == ':=')
                            <span class="badge badge-success">{{$item->op}}</span>
                        @else
                            <span class="badge badge-danger">{{$item->op}}</span>
                        @endif
                    </td>
                    <td>{{$item->value}}</td>
                    <td>
                        <a href="{{route('editredcheck', $item->id)}}" class="btn btn-primary btn-sm">Edit</a>
                        <form action="{{route('destroyRedcheck', $item->id)}}" method="POST" class="d-inline">
                            @csrf
                            @method('delete')
                            <button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')">Delete</button>
                        </form>
                    </td>
                </tr>
            @endforeach
        </tbody>
    </table>
    <h4>radusergroup Table</h4>
    <table class="table">
        <thead>
            <tr>
                <th>Id</th>
                <th>User name</th>
                <th>Group Id</th>
                <th>Priority</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
            @foreach ($reduser_group as $item)
                <tr>
                    <td>{{$item->id}}</td>
                    <td>{{$item->username}}</td>
                    <td>{{$item->groupname}}</td>

                    <td>{{$item->priority}}</td>
                    <td>
                        <a href="{{route('editredusergroup', $item->id)}}" class="btn btn-primary btn-sm">Edit</a>
                        <form action="{{route('destroyReduserGroup', $item->id)}}" method="POST" class="d-inline">
                            @csrf
                            @method('delete')
                            <button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')">Delete</button>
                        </form>
                    </td>
                </tr>
            @endforeach
        </tbody>
    </table>
</div>
