class
Illuminate
/
Foundation
/
Http
/
Middleware
/
VerifyCsrfToken
VerifyCsrfToken
Uses
Properties
protected
$except
array
The URIs that should be excluded from CSRF verification.
Default: []
protected
$addHttpCookie bool
Indicates whether the XSRF-TOKEN cookie should be set on the response.
Default: true
Methods
public
__construct ( Application $app , Encrypter $encrypter ) : void
Create a new middleware instance.
Parameters
- $app Application
- $encrypter Encrypter
protected
isReading ( $request ) : bool
Determine if the HTTP request uses a ‘read’ verb.
Parameters
- $request Request
protected
runningUnitTests ( ) : bool
Determine if the application is running unit tests.
protected
inExceptArray ( $request ) : bool
Determine if the request has a URI that should pass through CSRF verification.
Parameters
- $request Request
protected
tokensMatch ( $request ) : bool
Determine if the session and input CSRF tokens match.
Parameters
- $request Request
protected
getTokenFromRequest ( $request ) : string|null
Get the CSRF token from the request.
Parameters
- $request Request
public
shouldAddXsrfTokenCookie ( ) : bool
Determine if the cookie should be added to the response.
protected
addCookieToResponse ( $request , $response ) : Symfony\...\Response
Add the CSRF token to the response cookies.
Parameters
- $request Request
- $response Symfony\...\Response
protected
newCookie ( $request , $config ) : Symfony\...\Cookie
Create a new "XSRF-TOKEN" cookie that contains the CSRF token.
Parameters
- $request Request
- $config array
public
static
serialized ( ) : bool
Determine if the cookie contents should be serialized.