src/Support/Http/Responses/Stream.php
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();
    }
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();
    }
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 ( ) ; }
Get error from chunk if it exists.

@param  string  $path
@param  array  $data
@return array|null
Get error from chunk if it exists .