<?php

namespace App\Http\Controllers;

use App\Models\Invoice;
use Illuminate\View\View;

class InvoiceVerificationController extends Controller
{
    public function show(string $code): View
    {
        $invoice = Invoice::with(['customer', 'items', 'issuer'])
            ->where('verification_code', strtoupper($code))
            ->firstOrFail();

        return view('invoices.verify', compact('invoice'));
    }
}