<?php

namespace App\Filament\Resources\ContractResource\Pages;

use App\Filament\Resources\ContractResource;
use Filament\Resources\Pages\EditRecord;

class EditContract extends EditRecord
{
    protected static string $resource = ContractResource::class;

    protected function mutateFormDataBeforeSave(array $data): array
    {
        ContractResource::validateDriverOrFail((int) $data['driver_id']);
        return $data;
    }
}
