<?php

declare(strict_types=1);

namespace TechnoArtisan\FilamentCms\Models;

use Illuminate\Database\Eloquent\Attributes\UseFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use TechnoArtisan\FilamentCms\Database\Factories\ContactRequestErrorFactory;

#[UseFactory(ContactRequestErrorFactory::class)]
class ContactRequestError extends Model
{
    use HasFactory;

    protected $table = 'fcms_contact_request_errors';

    protected $fillable = [
        'session_id',
        'exception',
        'request',
        'session',
        'validated_data',
    ];

    protected function casts(): array
    {
        return [
            'exception'      => 'json',
            'request'        => 'json',
            'session'        => 'json',
            'validated_data' => 'json',
        ];
    }
}
