Files
WitShop/resources/views/admin/faqs/index.blade.php
T
marcoandClaude Sonnet 4.6 41078fdc08 Initial commit: WitShop Laravel Online-Shop
- Laravel 11, Blade, Alpine.js, Tailwind CSS
- Produkt- & Kategorieverwaltung mit Varianten
- Checkout (Vorkasse + Rechnung), Session-Warenkorb
- Admin-Backend (Dashboard, Bestellungen, Kunden, CMS)
- DSGVO-konform: Cookie-Consent, Impressum, Widerruf, AGB
- PDF-Rechnung via dompdf, SMTP-Mailversand
- Kundenverwaltung mit manueller Freischaltung

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 00:34:09 +02:00

48 lines
2.4 KiB
PHP

@extends('layouts.admin')
@section('title', 'FAQ')
@section('content')
<div class="grid grid-cols-3 gap-6">
<div>
<div class="bg-white rounded shadow p-5 mb-4">
<h3 class="font-semibold mb-3">Neue Gruppe</h3>
<form method="POST" action="{{ route('admin.faqs.groups.store') }}" class="space-y-2">
@csrf
<input type="text" name="name" placeholder="Gruppenname" class="w-full border rounded px-3 py-2 text-sm" required>
<button class="w-full bg-blue-600 text-white py-2 rounded text-sm hover:bg-blue-700">Erstellen</button>
</form>
</div>
<div class="bg-white rounded shadow p-5">
<h3 class="font-semibold mb-3">Neue Frage</h3>
<form method="POST" action="{{ route('admin.faqs.store') }}" class="space-y-2">
@csrf
<select name="faq_group_id" class="w-full border rounded px-3 py-2 text-sm">
<option value="">Ohne Gruppe</option>
@foreach($groups as $g)<option value="{{ $g->id }}">{{ $g->name }}</option>@endforeach
</select>
<input type="text" name="question" placeholder="Frage" class="w-full border rounded px-3 py-2 text-sm" required>
<textarea name="answer" placeholder="Antwort" rows="3" class="w-full border rounded px-3 py-2 text-sm" required></textarea>
<button class="w-full bg-green-600 text-white py-2 rounded text-sm hover:bg-green-700">Hinzufügen</button>
</form>
</div>
</div>
<div class="col-span-2 space-y-4">
@foreach($groups as $group)
<div class="bg-white rounded shadow p-5">
<h3 class="font-semibold mb-3 text-blue-700">{{ $group->name }}</h3>
@foreach($group->faqs as $faq)
<div class="border-b pb-3 mb-3 last:border-0">
<p class="font-medium text-sm">{{ $faq->question }}</p>
<p class="text-sm text-gray-500 mt-1">{{ Str::limit($faq->answer, 100) }}</p>
<form method="POST" action="{{ route('admin.faqs.destroy', $faq) }}" class="mt-1" onsubmit="return confirm('Löschen?')">
@csrf @method('DELETE')
<button class="text-red-400 text-xs hover:text-red-600">Löschen</button>
</form>
</div>
@endforeach
</div>
@endforeach
</div>
</div>
@endsection