 <div class="table-responsive">
    <table id="example" class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                <th class="thbutton">Sl No</th>
                <th>Title</th>
                <th>Category</th>
                <th>Price</th>
                <th width="10%" class="text-center">Status</th>
                @if(in_array('course-category-edit', $authRolePermissions))
                <th class="thbutton">Edit</th>
                @endif
                @if(in_array('course-category-delete', $authRolePermissions))
                <th class="thbutton">Delete</th>
                @endif
                {{--<th class="thbutton">Action</th>--}}
            </tr>
        </thead>
        <tbody>
            @php $i=1;@endphp
            @if(count($data)>0)
                @foreach($data as $key=> $list)
                    <tr>
                        <td class="text-center">{{$data->firstItem() + $key}}</td>
                        <td><strong><a href="{!! route('courses.show',$list->id) !!}">{{ucfirst($list->course_title ?? '')}}</a></strong></td>
                        <td><strong>{!! $list->category->title ?? '' !!}</td>
                        <td><strong>{!! ($list->course_price == '') ? 'Free' : $list->course_price !!}</td>
                        <td class="text-center">
                            <div class="form-check form-check-inline{{$i}}">
                                <input class="form-check-input{{$i}} btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('courses.changeStatus')}}" data-id="{{$list->id}}" data-status="{{$list->status=='0' ? '1' : '0'}}" {{ $list->status=='1' ? 'checked' : ''}}>
                            </div>
                        </td>
                        @if(in_array('course-category-edit', $authRolePermissions))
                        <td class="text-center">
                            <a class="btn btn-warning edit" href="{!! route('courses.edit', $list->id) !!}"><i class="bi bi-pencil-square text-white"></i></a>
                        </td>
                        @endif
                        @if(in_array('course-category-delete', $authRolePermissions))
                        <td class="text-center">
                            <a data-url="{{route('courses.destroy', $list->id)}}" data-id="{{$list->id}}" class="btn btn-danger deleteDataCustom" 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
                        {{--<td class="text-center">
                            <div class="btn-group dropend">
                                <button type="button" class="btn btn-link dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
                                  <i class="bi bi-three-dots"></i>
                                </button>
                                <ul class="dropdown-menu " aria-labelledby="navbarDarkDropdownMenuLink">
                                    <li>
                                       <a class="dropdown-item" href="{!! route('course.assignments', $list->id) !!}">Assignment</a>
                                    </li>
                                </ul>
                            </div>
                        </td>--}}
                    </tr>
                    @php $i++; @endphp
                @endforeach
            @else
            <tr>
                <td colspan="13">No Data Found</td>
            </tr>
            @endif
        </tbody>
    </table>
</div>
<nav class="row align-items-center mt-3">
    <div class="col-md-10">
        {!! $data->onEachSide(0)->render('courses.pagination') !!}
    </div>
    <div class="col-lg-2 col-md-2 col-2 dataTables_length" id="example_length" style="text-align: right;">
        <i class="bi bi-funnel" style=" top: 11px;left: 20px;"></i>
        <select class="form-select sorting sorting-box" id="" name="example_length" aria-controls="example" style="padding-left: 30px;">
            <option value="10">Show: 10</option>
            <option value="30">Show: 30</option>
            <option value="50">Show: 50</option>
        </select>
    </div>
</nav>
</div>

