<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    use HasFactory;

    // Mengizinkan semua kolom diisi secara otomatis, kecuali kolom 'id'
    protected $guarded = ['id'];

    // Relasi: Satu pesanan (Order) memiliki banyak detail barang (Order Items)
    public function items()
    {
        return $this->hasMany(OrderItem::class);
    }
}