Files
ladill-merchant/resources/views/merchant/storefronts/create.blade.php
T
isaaccladandClaude Opus 4.8 8b68fad82c
Deploy Ladill Merchant / deploy (push) Successful in 1m1s
Build real shop/menu/booking storefronts (replace church giving UI).
The storefront create/edit/manage UI and the public storefront page were
give's church-donation flow relabeled. Replace with genuine merchant
storefronts, reusing the QR-core manager + validator (which already build
sections/services content):

- Merchant create: type picker (shop/menu/booking) + per-type editors in a
  shared partial (products/menu items with prices; bookable services with
  days/hours). x-if per type so inputs never collide across types.
- StorefrontController store/update/create now delegate to QrCodeManagerService
  for all three types (was hardcoded church org_type/denomination/collection).
- Storefront show = QR preview + download + live toggle + delete + full editor.
- QrCodeManagerService: shop/menu/booking are free (no QR-wallet gate); drop
  the duplicate church TYPE_SHOP arm in hasContentChanges.
- Public: new storefront catalog+cart view for shop/menu (posts items[] to the
  existing order/Pay flow); route shop+menu to it. Booking already had a real
  public page; church TYPE_SHOP landing branch retired.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 10:24:39 +00:00

58 lines
3.3 KiB
PHP

<x-user-layout>
<x-slot name="title">Create storefront</x-slot>
@php $createType = old('type', $requestedType ?? \App\Models\QrCode::TYPE_SHOP); @endphp
<div class="mx-auto max-w-2xl space-y-6" x-data="{ type: @js($createType) }">
<div>
<a href="{{ route('merchant.storefronts.index') }}" class="inline-flex items-center gap-1 text-sm text-slate-500 hover:text-slate-700">
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5"/></svg>
All storefronts
</a>
<h1 class="mt-2 text-xl font-semibold text-slate-900">Create storefront</h1>
<p class="mt-1 text-sm text-slate-500">Pick what you're selling, then add your products, menu, or bookable services.</p>
</div>
@if(session('error'))
<div class="rounded-xl border border-red-100 bg-red-50 px-4 py-3 text-sm text-red-700">{{ session('error') }}</div>
@endif
@if($errors->any())
<div class="rounded-xl border border-red-100 bg-red-50 px-4 py-3 text-sm text-red-700">
<ul class="list-inside list-disc space-y-0.5">
@foreach($errors->all() as $error)<li>{{ $error }}</li>@endforeach
</ul>
</div>
@endif
<form method="post" action="{{ route('merchant.storefronts.store') }}" enctype="multipart/form-data" class="space-y-5 rounded-2xl border border-slate-200 bg-white p-6">
@csrf
<div>
<p class="mb-2 text-xs font-semibold text-slate-600">Storefront type</p>
<div class="grid grid-cols-3 gap-2">
@foreach(\App\Support\Qr\QrTypeCatalog::all() as $key => $meta)
<button type="button" @click="type = '{{ $key }}'"
:class="type === '{{ $key }}' ? 'border-indigo-500 bg-indigo-50 text-indigo-700' : 'border-slate-200 bg-white text-slate-500 hover:border-slate-300'"
class="rounded-xl border-2 px-3 py-3 text-left transition">
<span class="block text-sm font-semibold">{{ $meta['label'] }}</span>
<span class="mt-0.5 block text-[11px] leading-tight opacity-80">{{ $meta['description'] }}</span>
</button>
@endforeach
</div>
<input type="hidden" name="type" :value="type">
</div>
<div>
<label class="block text-sm font-medium text-slate-700">Dashboard label</label>
<input type="text" name="label" value="{{ old('label') }}" required maxlength="120"
placeholder="e.g. Main shop"
class="mt-1 w-full rounded-xl border-slate-200 text-sm focus:border-indigo-500 focus:ring-indigo-500">
<p class="mt-1 text-xs text-slate-400">Private name to find this storefront in your dashboard.</p>
</div>
@include('merchant.storefronts.partials.editor-fields', ['content' => []])
<button type="submit" class="btn-primary w-full">Create storefront</button>
</form>
</div>
</x-user-layout>