  @php
    $authCheck = auth()->check();
    $permission= auth()->user();
@endphp
 <table class="table table-striped">
                        <thead class="border-bottom">
                            <tr>
                                <th>S.No.</th>
                                <th>Image</th>
                                <th>Name</th>
                                <!-- <th>Status</th>  -->
                                <th>Actions</th> 
                            </tr>
                        </thead>
                       
                        <tbody>
                            @foreach($subjects as $key => $subject)
                            <tr>
                                <td>{{ $key + 1 }}</td>
                                 <td>
                                    {{-- <div class="d-flex align-items-center">
                                        <img src="{{ file_exists(public_path('storage/subjects/' . $subject->icon)) && $subject->icon
                                            ? url('storage/subjects/' . $subject->icon)
                                            : asset('img/no-image-available.jpg') }}"
                                            alt="" class="rounded-circle me-2"
                                            style="width: 80px; height: 80px; object-fit: cover;">
                                        
                                    </div> --}}

                                    <div class="d-flex align-items-center">
                                        @php
                                            $iconPath = 'storage/subjects/' . $subject->icon;
                                            $iconUrl = (file_exists(public_path($iconPath)) && $subject->icon)
                                                        ? url($iconPath)
                                                        : asset('img/no-image.png');
                                        @endphp
                                        <img src="{{ $iconUrl }}"
                                            alt="Subject Icon"
                                            class="rounded-circle me-2"
                                            style="width: 80px; height: 80px; object-fit: cover;">
                                    </div>
                                </td>
                                <td>{{ $subject->name }}</td>
                               
                                <!-- <td>{{ $subject->status == 1 ? 'Active' : 'Inactive' }}</td> -->
                                 <!-- <td class="ms-2" id="statusLabel{{ $subject->id }}">
                                    {{ $subject->status == 1 ? 'Active' : 'Inactive' }}
                                 </td> -->
                                
                                <td class="">
                                    
                                <div class="d-flex align-items-center">
                                    <div class="lights">
                                        {{-- <div class="form-check form-switch mb-0 h-100"></div> --}}
                                            <!-- <input 
                                                class="form-check-input mt-0 change-status" 
                                                type="checkbox" 
                                                id="statusSwitch{{ $subject->id }}" 
                                                name="statusSwitch" 
                                                value="1"
                                                data-id="{{ base64_encode($subject->id) }}"
                                                data-name="{{ $subject->title }}"
                                                {{ $subject->status == 1 ? 'checked' : '' }}
                                            > -->
                                             <!-- <label class="ms-2" id="statusLabel{{ $subject->id }}">
                                                {{ $subject->status == 1 ? 'Active' : 'Inactive' }}
                                            </label> -->
                                    </div>
                                    
                                    <a href="{{ route('admin.subject.edit', base64_encode($subject->id)) }}" class="text-success me-3" data-bs-toggle="tooltip" data-bs-placement="top" title="Edit">
                                        <i class="fa-solid fa-pen-to-square"></i>
                                    </a> 
                                    
                                    <a href="javascript:void(0);" 
                                        class="text-danger me-2 delete-btn" 
                                        data-bs-toggle="tooltip" data-bs-placement="top" title="Delete"
                                        data-id="{{ base64_encode($subject->id) }}">
                                            <i class="fa-solid fa-trash"></i>
                                    </a>
                                   
                                </div>
                                
                                </td>

                            </tr>


                            @endforeach
                          
                        </tbody>
                    </table>
                    <div class="pagination-wrapper mb-4">
                        {{ $subjects->links() }}
                    </div>