- ShopCatalog als gemeinsame Datenquelle der Kacheln, shop/kachel als Partial - Titelbild nur mit Website-Freigabe (PresentationMedia::coverPresentation), schmueckend mit leerem alt - Symbol je Materialart (Stammdaten), Marker Neu, Aktualisiert, Beliebt mit Einstellung am Artikel - Migration 2026_12_01_100000, rein ergaenzend - ADR-54, Plan, DEPLOYMENT.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
33 lines
1.1 KiB
PHP
33 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Domain\Commerce\Shop;
|
|
use App\Domain\Commerce\ShopCatalog;
|
|
use Illuminate\Http\RedirectResponse;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\View\View;
|
|
|
|
/**
|
|
* Durchsuchbarer Shop: macht kaufbare Produkte auffindbar. Treffer öffnen dieselbe öffentliche Produktseite wie die
|
|
* Programmkacheln. Gelistet wird nur, was mindestens eine kaufbare Option hat; die Kacheln bildet ShopCatalog.
|
|
*/
|
|
class ShopController extends Controller
|
|
{
|
|
/**
|
|
* Hinweisseite, solange der Shop sichtbar, der Checkout aber noch nicht freigegeben ist: Wer „Kaufen“ wählt, sieht,
|
|
* dass der Kauf zum Verkaufsstart möglich wird. Ist der Checkout offen, gibt es sie nicht mehr.
|
|
*/
|
|
public function closed(): View|RedirectResponse
|
|
{
|
|
return Shop::checkoutOpen() ? redirect()->route('shop') : view('shop.closed');
|
|
}
|
|
|
|
public function index(Request $request, ShopCatalog $catalog): View
|
|
{
|
|
$term = trim((string) $request->query('suche', ''));
|
|
|
|
return view('shop.index', ['cards' => $catalog->cards($term), 'term' => $term]);
|
|
}
|
|
}
|