File: /home/u756937133/domains/swingersnest.com/public_html/resources/views/admin/slides/index.blade.php
@extends('layouts.admin')
@section('title', 'Slides - Admin Panel')
@section('content')
<div class="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<h1 class="text-3xl font-extrabold text-secondary">Carousel Slides</h1>
<a href="{{ route('admin.slides.create') }}" class="inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-primary-dark">
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
</svg>
Add New Slide
</a>
</div>
@if(session('success'))
<div class="mb-4 rounded-lg bg-green-100 border border-green-400 text-green-700 px-4 py-3">
{{ session('success') }}
</div>
@endif
<div class="overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm text-gray-900">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">Image</th>
<th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">Title</th>
<th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">Subtitle</th>
<th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">Order</th>
<th class="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">Status</th>
<th class="px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
@forelse ($slides as $slide)
<tr class="hover:bg-gray-50">
<td class="px-6 py-4">
@if($slide->image)
<img src="{{ asset('storage/' . $slide->image) }}" alt="{{ $slide->title }}" class="h-16 w-24 object-cover rounded">
@else
<div class="h-16 w-24 bg-gray-200 rounded flex items-center justify-center">
<svg class="h-8 w-8 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
</div>
@endif
</td>
<td class="px-6 py-4">
<div class="text-sm font-medium text-gray-900">{{ $slide->title }}</div>
</td>
<td class="px-6 py-4">
<div class="text-sm text-gray-500 max-w-xs truncate">{{ $slide->subtitle }}</div>
</td>
<td class="px-6 py-4">
<div class="text-sm text-gray-500">{{ $slide->order }}</div>
</td>
<td class="px-6 py-4">
@if($slide->is_active)
<span class="inline-flex rounded-full bg-green-100 px-2 py-1 text-xs font-semibold text-green-800">Active</span>
@else
<span class="inline-flex rounded-full bg-gray-100 px-2 py-1 text-xs font-semibold text-gray-800">Inactive</span>
@endif
</td>
<td class="px-6 py-4 text-right text-sm font-medium">
<div class="flex items-center justify-end gap-2">
<a href="{{ route('admin.slides.edit', $slide) }}" class="text-primary hover:text-primary-dark">
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
</svg>
</a>
<form action="{{ route('admin.slides.destroy', $slide) }}" method="POST" class="inline" onsubmit="return confirm('Are you sure you want to delete this slide?');">
@csrf
@method('DELETE')
<button type="submit" class="text-red-600 hover:text-red-800">
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
</svg>
</button>
</form>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-6 py-12 text-center text-sm text-gray-500">
No slides found. <a href="{{ route('admin.slides.create') }}" class="text-primary hover:underline">Create your first slide</a>
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
@endsection