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