From 62b3fcd479e93a2c9d4162a929a85f6f821cf8f8 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Wed, 10 Jun 2026 09:23:00 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20fatal=20duplicate=20symbols=20from=20chur?= =?UTF-8?q?ch=E2=86=92shop/menu=20rename.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The customize script's blind TYPE_CHURCH→TYPE_SHOP and churchLogo→menuLogo replacements created a duplicate QrCode::TYPE_SHOP constant and duplicate QrScanController::menuLogo()/menuCover() methods — fatal at request time (crashed /dashboard with 500). The menu* methods already cover TYPE_SHOP, so drop the redundant church-origin copies. Co-Authored-By: Claude Opus 4.8 --- .../Controllers/Public/QrScanController.php | 30 ------------------- app/Models/QrCode.php | 1 - 2 files changed, 31 deletions(-) diff --git a/app/Http/Controllers/Public/QrScanController.php b/app/Http/Controllers/Public/QrScanController.php index f914722..849499d 100644 --- a/app/Http/Controllers/Public/QrScanController.php +++ b/app/Http/Controllers/Public/QrScanController.php @@ -254,36 +254,6 @@ class QrScanController extends Controller return Storage::disk('qr')->response($path); } - public function menuLogo(string $shortCode): StreamedResponse - { - $qrCode = QrCode::query() - ->where('short_code', $shortCode) - ->where('is_active', true) - ->firstOrFail(); - - abort_unless($qrCode->type === QrCode::TYPE_SHOP, 404); - - $path = $qrCode->content()['logo_path'] ?? null; - abort_unless($path && Storage::disk('qr')->exists($path), 404); - - return Storage::disk('qr')->response($path); - } - - public function menuCover(string $shortCode): StreamedResponse - { - $qrCode = QrCode::query() - ->where('short_code', $shortCode) - ->where('is_active', true) - ->firstOrFail(); - - abort_unless($qrCode->type === QrCode::TYPE_SHOP, 404); - - $path = $qrCode->content()['cover_path'] ?? null; - abort_unless($path && Storage::disk('qr')->exists($path), 404); - - return Storage::disk('qr')->response($path); - } - public function paymentLogo(string $shortCode): StreamedResponse { return $this->serveContentImage($shortCode, QrCode::TYPE_PAYMENT, 'logo_path'); diff --git a/app/Models/QrCode.php b/app/Models/QrCode.php index 04a3b79..4afad66 100644 --- a/app/Models/QrCode.php +++ b/app/Models/QrCode.php @@ -19,7 +19,6 @@ class QrCode extends Model public const TYPE_IMAGE = 'image'; public const TYPE_SHOP = 'shop'; public const TYPE_MENU = 'menu'; - public const TYPE_SHOP = 'shop'; public const TYPE_APP = 'app'; public const TYPE_BOOKING = 'booking'; /** @deprecated Legacy ebook type — migrated to {@see TYPE_BOOKING} */