<?php

namespace Daylight\Core\Modules\FormBuilder\Models;

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

class FormSubmission extends Model
{
    protected $fillable = [
        'form_id',
        'data',
        'files',
        'ip_address',
        'page_url',
    ];

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

    public function form(): BelongsTo
    {
        return $this->belongsTo(Form::class);
    }
}
