{{-- resources/views/ui/products/show.blade.php --}} @php $canUpdate = auth()->user()?->can('perm', 'products.update') ?? false; $statusPill = function (bool $active) { return $active ? 'bg-emerald-50 text-emerald-700 border-emerald-200' : 'bg-red-50 text-red-700 border-red-200'; }; @endphp
{{-- Header --}}
{{ $product->name }}
Artikel #{{ $product->id }} @if ($product->active ?? true) Aktiv @else Inaktiv @endif
{{ $product->description ?: 'Keine Beschreibung hinterlegt.' }}
Zurück @if ($canUpdate) Bearbeiten @endif
{{-- Quick stats --}}
Varianten
{{ $product->variants->count() }}
Gesamt
Aktiv
{{ $product->variants->where('active', true)->count() }}
Bestellbar
Inaktiv
{{ $product->variants->where('active', false)->count() }}
Nicht bestellbar
{{-- Varianten-Liste --}}
Varianten
z.B. Größe, Ausführung, Typ.
@forelse($product->variants as $v) @php $pill = $statusPill((bool) $v->active); @endphp
{{ $v->name }}
{{ $v->active ? 'Aktiv' : 'Inaktiv' }} Variante #{{ $v->id }}
{{ $v->active ? 'Kann bestellt/gebucht werden.' : 'Wird in Auswahl & Bestellungen ausgeblendet.' }}
@if ($canUpdate)
@csrf
@endif
@empty
Keine Varianten vorhanden.
@endforelse
{{-- Variante anlegen --}} @if ($canUpdate)
Variante anlegen
Wird dem Artikel zugeordnet.
@csrf
@error('name')
{{ $message }}
@enderror
Tipp: Verwende konsistente Namensschemata (z.B. „Größe S/M/L“, „500 ml“, „Set 10 Stk“).
@endif