protected function parseAuthHeader($header = 'authorization', $method = 'bearer')
    {
        $header = $this->request->headers->get($header);

        if (! starts_with(strtolower($header), $method)) {
            return false;
        }

        return trim(str_ireplace($method, '', $header));
    }
protected function parseAuthHeader($header = 'authorization', $method = 'bearer')
    {
        $header = $this->request->headers->get($header);

        if (! starts_with(strtolower($header), $method)) {
            return false;
        }

        return trim(str_ireplace($method, '', $header));
    }
protected function parseAuthHeader ( $ header = 'authorization' , $ method = 'bearer' ) { $ header = $ this -> request -> headers -> get ( $ header ) ; if ( ! starts_with ( strtolower ( $ header ) , $ method ) ) { return false ; } return trim ( str_ireplace ( $ method , '' , $ header ) ) ; }
Parse token from the authorization header.

@param string $header
@param string $method

@return false|string
Parse token from the authorization header .