@extends('layouts.admin') @section('title', 'Kelola Kategori Gaun - Lourent Admin') @section('content')
{{-- Flash Notifications --}} @if(session('success')) @endif @if(session('error')) @endif @if($errors->any()) @endif {{-- Top Action Header --}}

Kelola Kategori & Sub-Kategori

Kelola klasifikasi busana, aksesoris, urutan katalog, dan aturan rental Lourent.

Ke Stok Gaun
{{-- Stat Cards --}}
Total Kategori

{{ number_format($totalCategories) }}

Grup busana & aksesoris
Sub-Kategori

{{ number_format($totalSubCategories) }}

Variasi / kriteria spesifik
Aturan Khusus

{{ number_format($requiresDressCount) }}

Wajib sewa bersama dress
Gaun Terkategori

{{ number_format($totalDressesCategorized) }}

Koleksi terkelompok rapi
{{-- Main Filter & Table Card --}}
{{-- Filter Header --}}
@if(!empty($search) || $filterType !== 'all') @endif
{{-- Table --}}
@forelse($categories as $c) @php $imageUrl = null; if (!empty($c->image)) { $imageUrl = str_starts_with($c->image, 'http') ? $c->image : asset('storage/' . $c->image); } $iconClass = $c->icon ?: 'fa-tags'; if (!str_starts_with($iconClass, 'fa-') && !str_starts_with($iconClass, 'fa ')) { $iconClass = 'fa-' . $iconClass; } $subCatsJson = $c->subCategories->map(fn($s) => [ 'id' => $s->id, 'name' => $s->name, 'slug' => $s->slug, 'dresses_count' => $s->dresses_count ?? 0, 'delete_url' => route('admin.categories.sub-categories.destroy', $s->id), ])->values()->toJson(); @endphp @empty @endforelse
Urutan Icon Nama Kategori & Slug Aturan Rental Sub-Kategori Terdaftar Jumlah Gaun Aksi
#{{ $c->sort_order }} @if($imageUrl) {{ $c->name }} @else
@endif
{{ $c->name }}
{{ $c->slug }}
@if($c->requires_dress) Aksesoris / Wajib Dress @else Sewa Mandiri @endif
@forelse($c->subCategories as $sub) {{ $sub->name }} @if(($sub->dresses_count ?? 0) > 0) ({{ $sub->dresses_count }}) @endif @empty Belum ada sub-kategori @endforelse
@if($c->dresses_count > 0) {{ $c->dresses_count }} Gaun @else 0 Gaun @endif
Belum ada data kategori ditemukan.
Silakan tambah kategori baru untuk mengelompokkan koleksi gaun.
{{-- Pagination --}} @if($categories->hasPages())
Menampilkan {{ $categories->firstItem() }} - {{ $categories->lastItem() }} dari {{ $categories->total() }} kategori
{{ $categories->links() }}
@endif
{{-- MODAL TAMBAH KATEGORI --}} {{-- MODAL EDIT KATEGORI --}} {{-- MODAL KELOLA SUB-KATEGORI --}} {{-- HIDDEN FORM UNTUK DELETE SUB-KATEGORI --}}
@csrf @method('DELETE')
{{-- MODAL HAPUS KATEGORI --}} @endsection @push('scripts') @endpush