<?php

namespace App\Models;

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

class FormPrintLog extends Model
{
    use HasUuids, HasFactory;

    protected $guarded = [];

    protected $casts = [
        'snapshot_data' => 'array',
        'printed_at' => 'datetime',
    ];

    public function template()
    {
        return $this->belongsTo(FormTemplate::class);
    }

    public function printedBy()
    {
        return $this->belongsTo(User::class, 'printed_by');
    }
}
