<?php

namespace App\Traits\Order;

use App\Models\OrderItem;

trait WithOrderItem
{
    public function loadOrderItems()
    {
        return $this->items = OrderItem::query()
            ->currentUser()
            ->where('user_id', auth()->id())
            ->whereNull('order_id')
            ->latest()
            ->get();
    }
}
