<?php

namespace App\Http\Controllers\App;

use App\Domains\Orders\Models\Order;
use App\Http\Controllers\Controller;
use Illuminate\View\View;

class OrderDetailController extends Controller
{
    public function __invoke(Order $order): View
    {
        abort_unless($order->tenant_id === auth()->user()->tenant_id, 404);

        return view('app.order-detail', [
            'order' => $order,
        ]);
    }
}
