'array', 'customer_address_snapshot' => 'array', 'already_read' => 'boolean', 'is_cancellation' => 'boolean', 'cancellation_accepted' => 'boolean', 'has_been_assessed' => 'boolean' ]; protected function serializeDate(DateTimeInterface $date) { return $date->format('Y-m-d H:i:s'); } public function items(): HasMany { return $this->hasMany(OrderItem::class, 'order_id', 'uuid'); } public function customer(): BelongsTo { return $this->belongsTo(Customer::class, 'customer_id', 'uuid'); } /** * Relasi ke tabel Transactions sebagai polimorfik */ public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'reference', 'reference_type', 'reference_id', 'uuid'); } public function getPaymentProofUrlAttribute($value) { if (!$value) return null; return asset('storage/' . $value); } }