<?php

namespace App\Livewire\Portal;

use App\Models\Order;
use Livewire\Component;

class MyOrders extends Component
{
    public function render()
    {
        $orders = Order::whereHas('quotation', fn ($q) => $q->where('user_id', auth()->id()))
            ->with('quotation')
            ->latest()
            ->get();

        return view('livewire.portal.my-orders', compact('orders'))
            ->layout('layouts.portal');
    }
}
