<?php

namespace App\Filament\Resources\OcrValidationResource\Pages;

use App\Filament\Resources\OcrValidationResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;

class CreateOcrValidation extends CreateRecord
{
    protected static string $resource = OcrValidationResource::class;

    public $photo1;

    protected function mutateFormDataBeforeCreate(array $data): array
    {
        if (!empty($data['serial_numbers'])) {
            $data['serial_numbers'] = json_decode($data['serial_numbers'], true);
        }

        return $data;
    }

}
