<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class EmailLogBody extends Model
{
    protected $fillable = [
        'email_log_id',
        'body_html',
        'body_text',
        'inline_css',
    ];

    protected function casts(): array
    {
        return [
            'inline_css' => 'boolean',
        ];
    }

    public function log(): BelongsTo
    {
        return $this->belongsTo(EmailLog::class, 'email_log_id');
    }
}
