<div class="table-responsive">
    <table id="example" class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                <th class="thbutton">Serial No</th>
                <th>Field Name</th>
                <th>Input Type</th>
                <th class="thbutton">Is Mandatory</th>
                <th class="thbutton">Is Readonly</th>
                <th class="thbutton">Status</th>
                 @if(in_array('enquiry-category-fields-edit', $authRolePermissions))
                 <th class="thbutton">Edit</th>
                 @endif
                 @if(in_array('enquiry-category-fields-delete', $authRolePermissions))
                 <th class="thbutton">Delete</th>
                 @endif
                </tr>
            </thead>
            <tbody>
            @php $i=1;@endphp
            @if(count($data)>0)
            @foreach($data as $key=> $list)
            <tr>
                <td>{{$data->firstItem() + $key}}</td>
                        <td>{{$list->field}}</td>
                        <td>{{ ucfirst($list->type)}}</td>
                        <td>
                            <div class="form-check form-check-inline{{$i}}">
                                <input class="form-check-input{{$i}} btn-lg changeStatus" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('enquiry-category-fields.changemenditory')}}" data-id="{{$list->id}}" data-status="@if($list->is_menditory=='0'){{'1'}}@elseif($list->is_menditory=='1'){{'0'}}@endif" @if($list->is_menditory=='1'){{'checked'}}@elseif($list->is_menditory=='0'){{''}}@endif>
                            </div>
                        </td>
                        <td>
                            <div class="form-check form-check-inline{{$i}}">
                                <input class="form-check-input{{$i}} btn-lg changeStatus" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('enquiry-category-fields.changereadonly')}}" data-id="{{$list->id}}" data-status="@if($list->is_readonly=='0'){{'1'}}@elseif($list->is_readonly=='1'){{'0'}}@endif" @if($list->is_readonly=='1'){{'checked'}}@elseif($list->is_readonly=='0'){{''}}@endif>
                            </div>
                        </td>
                        <td>
                            <div class="form-check form-check-inline{{$i}}">
                                <input class="form-check-input{{$i}} btn-lg changeStatus" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('enquiry-category-fields.changestatus')}}" data-id="{{$list->id}}" data-status="{!! $list->status=='0' ? '1' : '0' !!}" @if($list->status=='1'){{'checked'}}@elseif($list->status=='0'){{''}}@endif>
                            </div>
                        </td>
                        @if(in_array('enquiry-category-fields-edit', $authRolePermissions))
                        <td>
                            <button data-id="{{ $list->id }}" class="btn btn-outline-secondary edit" data-bs-toggle="modal" data-bs-target="#commonModal" title="Edit">
                                <i class="bi bi-pencil-square"></i>
                            </button>
                        </td>
                        @endif
                        @if(in_array('enquiry-category-fields-delete', $authRolePermissions))
                            <td>
                                <a data-url="{{route('enquiry-category-fields.destroy')}}" data-id="{{$list->id}}" class="btn btn-danger deleteData" href="#" class="text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
                                    <i class="bi bi-trash text-white"></i>
                                </a>
                            </td>
                        @endif
                    </tr>
                    @php $i++; @endphp
                @endforeach
            @else
                <tr>
                    <td colspan="5">No Data Found</td>
                </tr>
            @endif
        </tbody>
    </table>
</div>
<nav class="float-start mt-2">
    <ul class="pagination">
        {!! $data->onEachSide(0)->render('enquiry-categories.pagination') !!}
    </ul>
</nav>
</div>

