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