protected function getTokenFromHeader()
    {
        // if there is no authorization header present.
        if (!$this->getRequest()->headers->has('Authorization')) {
            // abort by returning null.
            return null;
        }

        // gets the full header string.
        $header = $this->getRequest()->headers->get('Authorization');

        // returns the token without the 'Bearer ' prefix.
        return Str::replaceFirst('Bearer ', '', $header);
    }
protected function getTokenFromHeader()
    {
        // if there is no authorization header present.
        if (!$this->getRequest()->headers->has('Authorization')) {
            // abort by returning null.
            return null;
        }

        // gets the full header string.
        $header = $this->getRequest()->headers->get('Authorization');

        // returns the token without the 'Bearer ' prefix.
        return Str::replaceFirst('Bearer ', '', $header);
    }
protected function getTokenFromHeader ( ) { // if there is no authorization header present. if ( ! $ this -> getRequest ( ) -> headers -> has ( 'Authorization' ) ) { // abort by returning null. return null ; } // gets the full header string. $ header = $ this -> getRequest ( ) -> headers -> get ( 'Authorization' ) ; // returns the token without the 'Bearer ' prefix. return Str :: replaceFirst ( 'Bearer ' , '' , $ header ) ; }
Parse the request looking for the authorization header.

@return null|string
Parse the request looking for the authorization header .