protected function checkCsrfToken(Request $request)
    {
        if (!$request->headers->has(self::CSRF_TOKEN_HEADER)) {
            return false;
        }

        return $this->csrfTokenManager->isTokenValid(
            new CsrfToken(
                $this->csrfTokenIntention,
                $request->headers->get(self::CSRF_TOKEN_HEADER)
            )
        );
    }
protected function checkCsrfToken(Request $request)
    {
        if (!$request->headers->has(self::CSRF_TOKEN_HEADER)) {
            return false;
        }

        return $this->csrfTokenManager->isTokenValid(
            new CsrfToken(
                $this->csrfTokenIntention,
                $request->headers->get(self::CSRF_TOKEN_HEADER)
            )
        );
    }
protected function checkCsrfToken ( Request $ request ) { if ( ! $ request -> headers -> has ( self :: CSRF_TOKEN_HEADER ) ) { return false ; } return $ this -> csrfTokenManager -> isTokenValid ( new CsrfToken ( $ this -> csrfTokenIntention , $ request -> headers -> get ( self :: CSRF_TOKEN_HEADER ) ) ) ; }
Checks the validity of the request's csrf token header.

@param Request $request

@return bool true/false if the token is valid/invalid, false if none was found in the request's headers.
Checks the validity of the request s csrf token header .