null, 'activeTab' => 'identity', 'importMethod' => 'single', // Identität 'name' => '', 'slug' => '', 'keyvisual' => null, 'emblem' => null, 'is_active' => false, // PLZ-Management 'zipSearch' => '', 'newZipCode' => '', 'newCityName' => '', 'rangeStart' => '', 'rangeEnd' => '', 'csvFile' => null, ]); mount(function ($hubId = null) { if ($hubId) { $hub = \App\Models\Hub::findOrFail($hubId); $this->hubId = $hub->id; $this->name = $hub->name; $this->slug = $hub->slug; $this->is_active = $hub->is_active; } }); // Auto-generate slug from name $updatedName = function ($value) { if (!$this->hubId) { // Only auto-generate for new hubs $this->slug = \Illuminate\Support\Str::slug($value); } }; $locations = computed(function () { if (!$this->hubId) { return collect(); } return \App\Models\HubLocation::where('hub_id', $this->hubId)->when($this->zipSearch, fn($q) => $q->where('zip_code', 'like', "%{$this->zipSearch}%")->orWhere('city_name', 'like', "%{$this->zipSearch}%"))->orderBy('zip_code')->paginate(50); }); $partners = computed(function () { if (!$this->hubId) { return collect(); } return \App\Models\Partner::where('hub_id', $this->hubId)->get(); }); // Dummy save function $save = function () { // In production: Validation und Speicherung session()->flash('message', __('Hub gespeichert (Dummy-Funktion)')); }; // Dummy functions für PLZ-Management $addSingleZip = function () { session()->flash('message', __('PLZ hinzugefügt (Dummy-Funktion)')); }; $addZipRange = function () { session()->flash('message', __('PLZ-Bereich importiert (Dummy-Funktion)')); }; $importCsv = function () { session()->flash('message', __('CSV importiert (Dummy-Funktion)')); }; $deleteLocation = function ($id) { session()->flash('message', __('PLZ gelöscht (Dummy-Funktion)')); }; ?>
{{-- Header --}}
{{ $hubId ? __('Hub bearbeiten') : __('Neuer Hub') }} (in Entwicklung) {{ $name ?: __('Regionalen Marktplatz konfigurieren') }}
{{ __('Zurück') }} {{ __('Speichern') }}
{{-- Flash Message --}} @if (session()->has('message'))
{{ session('message') }}
@endif {{-- Tabs --}} {{ __('Identität & Design') }} {{ __('Geografie & PLZ') }} {{ __('Partner-Monitor') }} {{-- TAB 1: Identität & Design --}} @if ($activeTab === 'identity')
{{-- Basis-Informationen --}}
{{ __('Hub-Name') }} * {{ __('Wird dem Kunden angezeigt, z.B. "Region Ostwestfalen-Lippe"') }} {{ __('URL-Slug') }} * {{ __('Für saubere URLs, z.B. b2in.eu/region/owl') }} {{ __('Status') }} {{ __('Hub ist aktiv und für Kunden sichtbar') }} {{ __('Inaktive Hubs sind im "Coming Soon"-Modus') }}
{{-- Vorschau --}}

{{ __('Vorschau: Kunden-Landingpage') }}

@if ($keyvisual) Keyvisual @else

{{ __('Keyvisual hochladen') }}

@endif

{{ $name ?: __('Ihr Hub-Name') }}

{{ __('Die besten Marken Europas, von Händlern aus Ihrer Nachbarschaft') }}

@if ($emblem)
Emblem
@endif
{{-- Keyvisual Upload --}} {{ __('Keyvisual (Hintergrundbild)') }} {{-- --}} {{ __('Atmosphärisches Regionalbild für emotionalen Einstieg') }}
{{ __('Beispiele: Hermannsdenkmal (OWL), Skyline (Frankfurt), Hafen (Hamburg)') }} • {{ __('Empfohlen: 1920x800px, max. 2MB') }}
{{-- Wappen Upload --}} {{ __('Wappen / Emblem') }} {{-- --}} {{ __('Offizielles Wappen oder Logo der Region für Vertrauen & Offizialität') }}
{{ __('Beispiele: Sparrenburg-Logo, Landeswappen') }} • {{ __('Empfohlen: 256x256px, PNG mit transparentem Hintergrund') }}
@endif {{-- TAB 2: Geografie & PLZ --}} @if ($activeTab === 'geography')
{{-- Info-Box --}}
{{ __('Die Mapping-Engine') }}
{{ __('Hier ordnen Sie Postleitzahlen diesem Hub zu. Gibt ein Kunde seine PLZ ein, wird er automatisch diesem regionalen Marktplatz zugewiesen und sieht lokale Händler.') }}
{{-- PLZ-Import Tools --}} {{ __('Postleitzahlen hinzufügen') }} {{ __('Einzeln') }} {{ __('Bereich') }} {{ __('CSV-Import') }}
{{-- Einzelne PLZ --}} @if ($importMethod === 'single')
{{ __('Postleitzahl') }} * {{ __('Stadt') }} *
{{ __('PLZ hinzufügen') }}
@endif {{-- PLZ-Bereich --}} @if ($importMethod === 'range')
{{ __('Von PLZ') }} * {{ __('Bis PLZ') }} *
{{ __('Bereich importieren') }} ⚠️ {{ __('Generiert automatisch alle PLZs im Bereich. Kann bei großen Bereichen mehrere Minuten dauern!') }}
@endif {{-- CSV-Import --}} @if ($importMethod === 'csv')
{{ __('CSV-Datei') }} * {{ __('Format: PLZ,Stadt (eine Zeile pro Eintrag)') }}
{{ __('Beispiel:') }} 33602,Bielefeld
33603,Bielefeld
33604,Bielefeld
{{ __('CSV importieren') }}
@endif
{{-- PLZ-Liste --}}
{{ __('Zugeordnete Postleitzahlen') }} @if ($hubId) ({{ $this->locations->total() }} {{ __('gesamt') }}) @endif
@if ($hubId) {{ __('PLZ') }} {{ __('Stadt') }} {{ __('Aktion') }} @forelse($this->locations as $location) {{ $location->zip_code }} {{ $location->city_name }} @empty

{{ __('Noch keine PLZs zugeordnet') }}

@endforelse
{{-- Pagination --}} @if ($this->locations->hasPages())
{{ $this->locations->links() }}
@endif @else
{{ __('Speichern Sie zuerst den Hub, um PLZs hinzuzufügen') }}
@endif
@endif {{-- TAB 3: Partner-Monitor --}} @if ($activeTab === 'partners') {{ __('Partner in diesem Hub') }} @if ($hubId) ({{ $this->partners->count() }} {{ __('Partner') }}) @endif {{-- Info --}}
{{ __('Logik:') }}
  • {{ __('Händler (Retailer) → Werden diesem Hub fest zugeordnet') }}
  • {{ __('Hersteller (Manufacturer) → Sind "Hub-agnostisch", in allen Hubs sichtbar') }}
  • {{ __('Makler (Estate-Agent) → Werden Hub zugeordnet für regionale Kundenakquise') }}
@if ($hubId) {{ __('Name') }} {{ __('Typ') }} {{ __('Stadt') }} {{ __('Lieferradius') }} {{ __('Status') }} {{ __('Aktion') }} @forelse($this->partners as $partner)
{{ $partner->company_name }}
@if ($partner->display_name && $partner->display_name !== $partner->company_name)
{{ $partner->display_name }}
@endif
@php $typeColors = [ 'Retailer' => 'blue', 'Manufacturer' => 'purple', 'Estate-Agent' => 'green', ]; @endphp {{ $partner->type }} {{ $partner->city ?? '-' }} @if ($partner->delivery_radius_km) {{ $partner->delivery_radius_km }} km @else - @endif {{ $partner->is_active ? __('Aktiv') : __('Inaktiv') }} {{ __('Details') }}
@empty

{{ __('Noch keine Partner in diesem Hub') }}

{{ __('Partner werden automatisch beim Onboarding zugeordnet (basierend auf PLZ)') }}

@endforelse
@else
{{ __('Speichern Sie zuerst den Hub, um Partner-Zuordnungen zu sehen') }}
@endif
@endif