protected function fetchToken(Request $request): string
    {
        if ($request->hasHeader(self::HEADER)) {
            return (string)$request->getHeaderLine(self::HEADER);
        }

        $data = $request->getParsedBody();
        if (is_array($data) && isset($data[self::PARAMETER])) {
            if (is_string($data[self::PARAMETER])) {
                return (string)$data[self::PARAMETER];
            }
        }

        return '';
    }
protected function fetchToken(Request $request): string
    {
        if ($request->hasHeader(self::HEADER)) {
            return (string)$request->getHeaderLine(self::HEADER);
        }

        $data = $request->getParsedBody();
        if (is_array($data) && isset($data[self::PARAMETER])) {
            if (is_string($data[self::PARAMETER])) {
                return (string)$data[self::PARAMETER];
            }
        }

        return '';
    }
protected function fetchToken ( Request $ request ) : string { if ( $ request -> hasHeader ( self :: HEADER ) ) { return ( string ) $ request -> getHeaderLine ( self :: HEADER ) ; } $ data = $ request -> getParsedBody ( ) ; if ( is_array ( $ data ) && isset ( $ data [ self :: PARAMETER ] ) ) { if ( is_string ( $ data [ self :: PARAMETER ] ) ) { return ( string ) $ data [ self :: PARAMETER ] ; } } return '' ; }
Fetch token from request.

@param Request $request
@return string
Fetch token from request .