protected function chunkError(string $path, array $data): ?array
    {
        if (! isset($data['errors'])) {
            return null;
        }

        return (new Collection($data['errors']))
            ->filter(function (array $error) use ($path): bool {
                return Str::startsWith(implode('.', $error['path']), $path);
            })
            ->values()
            ->toArray();
    }