<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class NotificationDelivery extends Model
{
    protected $guarded = [];

    protected function casts(): array
    {
        return [
            'payload' => 'array',
            'sent_at' => 'datetime',
        ];
    }

    public function notification()
    {
        return $this->belongsTo(CustomerNotification::class, 'customer_notification_id');
    }

    public function order()
    {
        return $this->belongsTo(Order::class);
    }
}
