<?php

use App\Models\Order;
use App\Models\OrderItem;
use App\Models\Product;
use Livewire\Attributes\Layout;
use Livewire\Component;

return new class extends Component
{
  #[Layout('layouts.store')]
  public $order, $orderitems;

  public function mount($orderid = null)
  {
    if ($orderid) {
      $this->order = Order::with('items')
        ->with('address')
        ->where(['order_number' => $orderid])
        ->first();
      $this->orderitems = $this->order ? $this->order->items : collect();
    }
  }

    protected function view($data = [])
    {
        return app('view')->file('C:\laragon\www\ecommerce\storage\framework/views/livewire/views/570e95b9.blade.php', $data);
    }
};
