@extends('admin.layouts.index-template', [ 'pageTitle' => 'Subcategorías', 'items' => $subCategories, 'icon' => 'grid', 'module' => 'Subcategorías', 'createRoute' => route('sub-categories.create'), 'indexRoute' => route('sub-categories.index'), 'searchPlaceholder' => 'Buscar por nombre, slug o categoría...', 'emptyIcon' => 'sitemap', 'emptyTitle' => 'No hay subcategorías', 'emptyMessage' => 'Comience agregando su primera subcategoría al catálogo', 'stats' => [ 'all' => [ 'label' => 'Total', 'count' => $subCategories->total(), 'color' => 'primary', 'icon' => 'grid' ], 'active' => [ 'label' => 'Activas', 'count' => \App\Models\Subcaweb::where('WEB_VTA', 'S')->where('BORRADO', 'N')->count(), 'color' => 'success', 'icon' => 'checkbox-circle' ], 'inactive' => [ 'label' => 'Inactivas', 'count' => \App\Models\Subcaweb::where('WEB_VTA', 'N')->where('BORRADO', 'N')->count(), 'color' => 'secondary', 'icon' => 'pause-circle' ], 'show_home' => [ 'label' => 'Inicio', 'count' => \App\Models\Subcaweb::where('showHome', 'Yes')->where('BORRADO', 'N')->count(), 'color' => 'warning', 'icon' => 'home' ], 'no_image' => [ 'label' => 'Sin Imagen', 'count' => \App\Models\Subcaweb::where('BORRADO', 'N') ->where(function($query) { $query->whereNull('image') ->orWhere('image', ''); })->count(), 'color' => 'info', 'icon' => 'image' ], 'no_products' => [ 'label' => 'Sin Productos', 'count' => \App\Models\Subcaweb::doesntHave('productos')->where('BORRADO', 'N')->count(), 'color' => 'danger', 'icon' => 'error-warning' ] ] ]) @push('css') @endpush @section('header-buttons') Nueva Subcategoría @endsection @section('action-buttons') @endsection @section('filters')
@endsection @section('table-headers') Código Imagen Subcategoría Categoría Productos Estado Inicio Fecha SEO con IA Acciones @endsection @section('table-body') @foreach($subCategories as $subCategory) {{ trim($subCategory->CO_CATEGOR) }} / {{ trim($subCategory->CO_SUBCATE) }} @if(!empty($subCategory->image)) {{ $subCategory->DE_SUBCATE }} @else
@endif
{{ $subCategory->DE_SUBCATE ?? 'Sin nombre' }}
{{ strtolower(str_replace(' ', '-', $subCategory->DE_SUBCATE ?? '')) }}
{{ $subCategory->categoria ? $subCategory->categoria->DE_CATEGOR : 'Sin categoría' }} @if($subCategory->productos_count > 0) {{ $subCategory->productos_count }} @else 0 @endif @if($subCategory->WEB_VTA == 'S') Activa @else Inactiva @endif @if($subCategory->showHome == 'Yes') @else No @endif - @if($subCategory->ai_generated_at && ($subCategory->ai_meta_title || $subCategory->ai_meta_description)) Generado @else No generado @endif
@if($subCategory->variedades_count > 0) @endif @if($subCategory->productos_count > 0) @endif
@endforeach @endsection