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>
This commit is contained in:
2026-06-20 00:34:09 +02:00
co-authored by Claude Sonnet 4.6
commit 41078fdc08
208 changed files with 21725 additions and 0 deletions
@@ -0,0 +1,108 @@
@extends('layouts.shop')
@section('title', 'Meine Adressen')
@section('content')
<h1 class="text-2xl font-bold mb-6">Mein Konto</h1>
<div class="grid grid-cols-1 md:grid-cols-4 gap-6">
{{-- Sidebar --}}
<div class="space-y-1 text-sm">
<a href="{{ route('account.index') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Übersicht</a>
<a href="{{ route('account.orders') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Bestellungen</a>
<a href="{{ route('account.addresses') }}" class="block px-3 py-2 rounded bg-blue-50 text-blue-700 font-semibold">Adressen</a>
<a href="{{ route('account.settings') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Einstellungen</a>
<form method="POST" action="{{ route('logout') }}">@csrf
<button class="w-full text-left px-3 py-2 rounded text-red-600 hover:bg-red-50">Abmelden</button>
</form>
</div>
{{-- Content --}}
<div class="md:col-span-3 space-y-6">
{{-- Gespeicherte Adressen --}}
@if($addresses->count())
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
@foreach($addresses as $addr)
<div class="bg-white border rounded-lg p-4 text-sm relative">
@if($addr->is_default)
<span class="absolute top-3 right-3 text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded-full">Standard</span>
@endif
<p class="font-semibold">{{ $addr->first_name }} {{ $addr->last_name }}</p>
@if($addr->company)<p class="text-gray-500">{{ $addr->company }}</p>@endif
<p class="text-gray-700 mt-1">{{ $addr->street }}</p>
<p class="text-gray-700">{{ $addr->zip }} {{ $addr->city }}</p>
@if($addr->phone)<p class="text-gray-400 text-xs mt-1">{{ $addr->phone }}</p>@endif
<form method="POST" action="{{ route('account.addresses.destroy', $addr) }}" class="mt-3"
onsubmit="return confirm('Adresse löschen?')">
@csrf @method('DELETE')
<button class="text-red-500 text-xs hover:underline">Löschen</button>
</form>
</div>
@endforeach
</div>
@else
<div class="bg-white border rounded-lg p-8 text-center text-gray-400 text-sm">
Noch keine Adressen gespeichert.
</div>
@endif
{{-- Neue Adresse --}}
<div class="bg-white border rounded-lg p-6">
<h2 class="font-semibold mb-4">Neue Adresse hinzufügen</h2>
<form method="POST" action="{{ route('account.addresses.store') }}" class="grid grid-cols-2 gap-4">
@csrf
<div>
<label class="block text-sm font-medium mb-1">Vorname *</label>
<input type="text" name="first_name" value="{{ old('first_name') }}" required
class="w-full border rounded px-3 py-2 text-sm">
</div>
<div>
<label class="block text-sm font-medium mb-1">Nachname *</label>
<input type="text" name="last_name" value="{{ old('last_name') }}" required
class="w-full border rounded px-3 py-2 text-sm">
</div>
<div class="col-span-2">
<label class="block text-sm font-medium mb-1">Firma (optional)</label>
<input type="text" name="company" value="{{ old('company') }}"
class="w-full border rounded px-3 py-2 text-sm">
</div>
<div class="col-span-2">
<label class="block text-sm font-medium mb-1">Straße und Hausnummer *</label>
<input type="text" name="street" value="{{ old('street') }}" required
class="w-full border rounded px-3 py-2 text-sm">
</div>
<div>
<label class="block text-sm font-medium mb-1">PLZ *</label>
<input type="text" name="zip" value="{{ old('zip') }}" required
class="w-full border rounded px-3 py-2 text-sm">
</div>
<div>
<label class="block text-sm font-medium mb-1">Ort *</label>
<input type="text" name="city" value="{{ old('city') }}" required
class="w-full border rounded px-3 py-2 text-sm">
</div>
<div>
<label class="block text-sm font-medium mb-1">Land *</label>
<input type="text" name="country" value="{{ old('country', 'DE') }}" required maxlength="2"
class="w-full border rounded px-3 py-2 text-sm uppercase">
</div>
<div>
<label class="block text-sm font-medium mb-1">Telefon (optional)</label>
<input type="text" name="phone" value="{{ old('phone') }}"
class="w-full border rounded px-3 py-2 text-sm">
</div>
@if($errors->any())
<div class="col-span-2 bg-red-50 border border-red-200 rounded p-3 text-sm text-red-700">
@foreach($errors->all() as $e)<p>• {{ $e }}</p>@endforeach
</div>
@endif
<div class="col-span-2">
<button type="submit" class="bg-blue-600 text-white px-5 py-2 rounded hover:bg-blue-700 text-sm">
Adresse speichern
</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@@ -0,0 +1,39 @@
@extends('layouts.shop')
@section('title', 'Mein Konto')
@section('content')
<h1 class="text-2xl font-bold mb-6">Mein Konto</h1>
<div class="grid grid-cols-1 md:grid-cols-4 gap-6">
<div class="space-y-1 text-sm">
<a href="{{ route('account.index') }}" class="block px-3 py-2 rounded {{ request()->routeIs('account.index') ? 'bg-blue-50 text-blue-700 font-semibold' : 'hover:bg-gray-50' }}">Übersicht</a>
<a href="{{ route('account.orders') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Bestellungen</a>
<a href="{{ route('account.addresses') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Adressen</a>
<a href="{{ route('account.settings') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Einstellungen</a>
<form method="POST" action="{{ route('logout') }}">@csrf
<button class="w-full text-left px-3 py-2 rounded text-red-600 hover:bg-red-50">Abmelden</button>
</form>
</div>
<div class="md:col-span-3">
<div class="bg-white border rounded-lg p-6 mb-6">
<p class="text-gray-600">Hallo, <strong>{{ auth()->user()->name }}</strong>!</p>
</div>
@if($orders->count())
<h2 class="font-semibold mb-3">Letzte Bestellungen</h2>
<div class="bg-white border rounded-lg overflow-hidden">
<table class="w-full text-sm">
<thead class="bg-gray-50"><tr><th class="px-4 py-2 text-left">Bestellnr.</th><th class="px-4 py-2 text-left">Status</th><th class="px-4 py-2 text-right">Betrag</th><th class="px-4 py-2"></th></tr></thead>
<tbody class="divide-y">
@foreach($orders as $o)
<tr>
<td class="px-4 py-2 font-mono">{{ $o->order_number }}</td>
<td class="px-4 py-2">{{ $o->status_label }}</td>
<td class="px-4 py-2 text-right">{{ number_format($o->total, 2, ',', '.') }} €</td>
<td class="px-4 py-2"><a href="{{ route('account.order', $o) }}" class="text-blue-600 text-xs hover:underline">Details</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
</div>
@endsection
@@ -0,0 +1,123 @@
@extends('layouts.shop')
@section('title', 'Bestellung ' . $order->order_number)
@section('content')
<h1 class="text-2xl font-bold mb-6">Mein Konto</h1>
<div class="grid grid-cols-1 md:grid-cols-4 gap-6">
{{-- Sidebar --}}
<div class="space-y-1 text-sm">
<a href="{{ route('account.index') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Übersicht</a>
<a href="{{ route('account.orders') }}" class="block px-3 py-2 rounded bg-blue-50 text-blue-700 font-semibold">Bestellungen</a>
<a href="{{ route('account.addresses') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Adressen</a>
<a href="{{ route('account.settings') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Einstellungen</a>
<form method="POST" action="{{ route('logout') }}">@csrf
<button class="w-full text-left px-3 py-2 rounded text-red-600 hover:bg-red-50">Abmelden</button>
</form>
</div>
{{-- Content --}}
<div class="md:col-span-3 space-y-5">
<div class="flex items-center justify-between">
<div>
<p class="text-sm text-gray-500">Bestellnummer</p>
<h2 class="text-lg font-mono font-bold">{{ $order->order_number }}</h2>
</div>
<span class="px-3 py-1 rounded-full text-sm font-medium
{{ match($order->status) {
'new' => 'bg-yellow-100 text-yellow-700',
'payment_received' => 'bg-blue-100 text-blue-700',
'processing' => 'bg-purple-100 text-purple-700',
'shipped' => 'bg-indigo-100 text-indigo-700',
'completed' => 'bg-green-100 text-green-700',
'cancelled' => 'bg-red-100 text-red-700',
default => 'bg-gray-100 text-gray-600',
} }}">
{{ $order->status_label }}
</span>
</div>
{{-- Artikel --}}
<div class="bg-white border rounded-lg overflow-hidden">
<div class="px-4 py-3 bg-gray-50 border-b text-sm font-semibold">Bestellte Artikel</div>
<table class="w-full text-sm">
<tbody class="divide-y">
@foreach($order->items as $item)
<tr>
<td class="px-4 py-3">
<p class="font-medium">{{ $item->product_name }}</p>
@if($item->variant_label)
<p class="text-gray-400 text-xs">{{ $item->variant_label }}</p>
@endif
</td>
<td class="px-4 py-3 text-gray-500 text-center">{{ $item->qty }}×</td>
<td class="px-4 py-3 text-right font-medium">{{ number_format($item->price * $item->qty, 2, ',', '.') }} €</td>
</tr>
@endforeach
</tbody>
<tfoot class="border-t bg-gray-50 text-sm">
<tr>
<td colspan="2" class="px-4 py-2 text-gray-500">Versand</td>
<td class="px-4 py-2 text-right">{{ number_format($order->shipping_cost, 2, ',', '.') }} €</td>
</tr>
<tr>
<td colspan="2" class="px-4 py-2 font-bold">Gesamt</td>
<td class="px-4 py-2 text-right font-bold text-lg">{{ number_format($order->total, 2, ',', '.') }} €</td>
</tr>
</tfoot>
</table>
</div>
{{-- Tracking --}}
@if($order->tracking_code)
<div class="bg-indigo-50 border border-indigo-200 rounded-lg px-4 py-3 text-sm">
<p class="font-semibold text-indigo-800">Sendungsverfolgung</p>
<p class="text-indigo-700 font-mono mt-1">{{ $order->tracking_code }}</p>
</div>
@endif
{{-- Zahlungshinweis Vorkasse --}}
@if($order->payment_method === 'vorkasse' && in_array($order->status, ['new']))
<div class="bg-amber-50 border border-amber-200 rounded-lg px-4 py-4 text-sm">
<p class="font-semibold text-amber-800 mb-2">Bitte überweisen Sie den Betrag auf folgendes Konto:</p>
<dl class="grid grid-cols-2 gap-1 text-amber-700">
<dt class="font-medium">Empfänger:</dt><dd>{{ \App\Models\Setting::get('shop_owner') }}</dd>
<dt class="font-medium">IBAN:</dt><dd class="font-mono">{{ \App\Models\Setting::get('bank_iban') }}</dd>
<dt class="font-medium">BIC:</dt><dd class="font-mono">{{ \App\Models\Setting::get('bank_bic') }}</dd>
<dt class="font-medium">Bank:</dt><dd>{{ \App\Models\Setting::get('bank_name') }}</dd>
<dt class="font-medium">Verwendungszweck:</dt><dd class="font-mono">{{ $order->order_number }}</dd>
<dt class="font-medium">Betrag:</dt><dd class="font-semibold">{{ number_format($order->total, 2, ',', '.') }} €</dd>
</dl>
</div>
@endif
{{-- Adressen --}}
<div class="grid grid-cols-2 gap-4 text-sm">
@php
$billing = $order->addresses->firstWhere('type', 'billing');
$shipping = $order->addresses->firstWhere('type', 'shipping');
@endphp
@if($billing)
<div class="bg-white border rounded-lg p-4">
<p class="text-xs text-gray-400 font-semibold uppercase mb-2">Rechnungsadresse</p>
<p class="font-medium">{{ $billing->first_name }} {{ $billing->last_name }}</p>
@if($billing->company)<p class="text-gray-500">{{ $billing->company }}</p>@endif
<p class="text-gray-700">{{ $billing->street }}</p>
<p class="text-gray-700">{{ $billing->zip }} {{ $billing->city }}</p>
</div>
@endif
@if($shipping)
<div class="bg-white border rounded-lg p-4">
<p class="text-xs text-gray-400 font-semibold uppercase mb-2">Lieferadresse</p>
<p class="font-medium">{{ $shipping->first_name }} {{ $shipping->last_name }}</p>
@if($shipping->company)<p class="text-gray-500">{{ $shipping->company }}</p>@endif
<p class="text-gray-700">{{ $shipping->street }}</p>
<p class="text-gray-700">{{ $shipping->zip }} {{ $shipping->city }}</p>
</div>
@endif
</div>
<a href="{{ route('account.orders') }}" class="inline-block text-sm text-gray-500 hover:text-blue-600">← Alle Bestellungen</a>
</div>
</div>
@endsection
@@ -0,0 +1,70 @@
@extends('layouts.shop')
@section('title', 'Meine Bestellungen')
@section('content')
<h1 class="text-2xl font-bold mb-6">Mein Konto</h1>
<div class="grid grid-cols-1 md:grid-cols-4 gap-6">
{{-- Sidebar --}}
<div class="space-y-1 text-sm">
<a href="{{ route('account.index') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Übersicht</a>
<a href="{{ route('account.orders') }}" class="block px-3 py-2 rounded bg-blue-50 text-blue-700 font-semibold">Bestellungen</a>
<a href="{{ route('account.addresses') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Adressen</a>
<a href="{{ route('account.settings') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Einstellungen</a>
<form method="POST" action="{{ route('logout') }}">@csrf
<button class="w-full text-left px-3 py-2 rounded text-red-600 hover:bg-red-50">Abmelden</button>
</form>
</div>
{{-- Content --}}
<div class="md:col-span-3">
@if($orders->count())
<div class="bg-white border rounded-lg overflow-hidden">
<table class="w-full text-sm">
<thead class="bg-gray-50 border-b text-left">
<tr>
<th class="px-4 py-3">Bestellnr.</th>
<th class="px-4 py-3">Status</th>
<th class="px-4 py-3">Zahlungsart</th>
<th class="px-4 py-3 text-right">Betrag</th>
<th class="px-4 py-3">Datum</th>
<th class="px-4 py-3"></th>
</tr>
</thead>
<tbody class="divide-y">
@foreach($orders as $order)
<tr class="hover:bg-gray-50">
<td class="px-4 py-3 font-mono font-medium">{{ $order->order_number }}</td>
<td class="px-4 py-3">
<span class="px-2 py-0.5 rounded text-xs
{{ match($order->status) {
'new' => 'bg-yellow-100 text-yellow-700',
'payment_received' => 'bg-blue-100 text-blue-700',
'processing' => 'bg-purple-100 text-purple-700',
'shipped' => 'bg-indigo-100 text-indigo-700',
'completed' => 'bg-green-100 text-green-700',
'cancelled' => 'bg-red-100 text-red-700',
default => 'bg-gray-100 text-gray-600',
} }}">
{{ $order->status_label }}
</span>
</td>
<td class="px-4 py-3 text-gray-500">{{ $order->payment_label }}</td>
<td class="px-4 py-3 text-right font-medium">{{ number_format($order->total, 2, ',', '.') }} €</td>
<td class="px-4 py-3 text-gray-400">{{ $order->created_at->format('d.m.Y') }}</td>
<td class="px-4 py-3 text-right">
<a href="{{ route('account.order', $order) }}" class="text-blue-600 hover:underline text-xs">Details</a>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="px-4 py-3 border-t">{{ $orders->links() }}</div>
</div>
@else
<div class="bg-white border rounded-lg p-10 text-center text-gray-400 text-sm">
Sie haben noch keine Bestellungen aufgegeben.
</div>
@endif
</div>
</div>
@endsection
@@ -0,0 +1,58 @@
@extends('layouts.shop')
@section('title', 'Kontoeinstellungen')
@section('content')
<h1 class="text-2xl font-bold mb-6">Mein Konto</h1>
<div class="grid grid-cols-1 md:grid-cols-4 gap-6">
{{-- Sidebar --}}
<div class="space-y-1 text-sm">
<a href="{{ route('account.index') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Übersicht</a>
<a href="{{ route('account.orders') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Bestellungen</a>
<a href="{{ route('account.addresses') }}" class="block px-3 py-2 rounded hover:bg-gray-50">Adressen</a>
<a href="{{ route('account.settings') }}" class="block px-3 py-2 rounded bg-blue-50 text-blue-700 font-semibold">Einstellungen</a>
<form method="POST" action="{{ route('logout') }}">@csrf
<button class="w-full text-left px-3 py-2 rounded text-red-600 hover:bg-red-50">Abmelden</button>
</form>
</div>
{{-- Content --}}
<div class="md:col-span-3">
<div class="bg-white border rounded-lg p-6">
<h2 class="font-semibold mb-4">Persönliche Daten</h2>
<form method="POST" action="{{ route('account.settings.update') }}" class="space-y-4">
@csrf @method('PUT')
<div>
<label class="block text-sm font-medium mb-1">Name *</label>
<input type="text" name="name" value="{{ old('name', auth()->user()->name) }}" required
class="w-full border rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium mb-1">E-Mail-Adresse *</label>
<input type="email" name="email" value="{{ old('email', auth()->user()->email) }}" required
class="w-full border rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<hr>
<p class="text-sm text-gray-500">Passwort ändern — leer lassen, wenn Sie es nicht ändern möchten.</p>
<div>
<label class="block text-sm font-medium mb-1">Neues Passwort</label>
<input type="password" name="password" autocomplete="new-password"
class="w-full border rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium mb-1">Passwort bestätigen</label>
<input type="password" name="password_confirmation" autocomplete="new-password"
class="w-full border rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
@if($errors->any())
<div class="bg-red-50 border border-red-200 rounded p-3 text-sm text-red-700">
@foreach($errors->all() as $e)<p>• {{ $e }}</p>@endforeach
</div>
@endif
<button type="submit" class="bg-blue-600 text-white px-5 py-2 rounded hover:bg-blue-700 text-sm">
Speichern
</button>
</form>
</div>
</div>
</div>
@endsection