*/ protected $fillable = [ // 'order_id', // Jika Anda memutuskan untuk mengembalikan kolom ini di DB 'customer_name', 'customer_email', 'table_id', 'total_amount', 'payment_method', 'transaction_status', 'midtrans_transaction_id', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'total_amount' => 'decimal:2', // Pastikan presisi 2 desimal 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; /** * Get the order items for the order. */ public function items() { return $this->hasMany(OrderItem::class, 'order_id', 'id'); } }