public function getCredentials(Request $request)
    {
        $token = !empty($request->headers->get(self::AUTHORIZATION_HEADER)) ?
            $request->headers->get(self::AUTHORIZATION_HEADER) :
            $request->cookies->get(AuthResponseService::AUTH_COOKIE);

        return new CredentialTokenModel(str_replace(self::BEARER, '', $token));
    }
public function getCredentials(Request $request)
    {
        $token = !empty($request->headers->get(self::AUTHORIZATION_HEADER)) ?
            $request->headers->get(self::AUTHORIZATION_HEADER) :
            $request->cookies->get(AuthResponseService::AUTH_COOKIE);

        return new CredentialTokenModel(str_replace(self::BEARER, '', $token));
    }
public function getCredentials ( Request $ request ) { $ token = ! empty ( $ request -> headers -> get ( self :: AUTHORIZATION_HEADER ) ) ? $ request -> headers -> get ( self :: AUTHORIZATION_HEADER ) : $ request -> cookies -> get ( AuthResponseService :: AUTH_COOKIE ) ; return new CredentialTokenModel ( str_replace ( self :: BEARER , '' , $ token ) ) ; }
2) Gets the token from header and creates a CredentialToken Model

@param Request $request
@return null|CredentialTokenModel
2 ) Gets the token from header and creates a CredentialToken Model