Menu

## CorsService
in package

CorsService.php : 38

##### Tags

phpstan-type

  CorsInputOptions array{ 'allowedOrigins'?: string[], 'allowedOriginsPatterns'?: string[], 'supportsCredentials'?: bool, 'allowedHeaders'?: string[], 'allowedMethods'?: string[], 'exposedHeaders'?: string[]|false, 'maxAge'?: int|bool|null, 'allowed_origins'?: string[], 'allowed_origins_patterns'?: string[], 'supports_credentials'?: bool, 'allowed_headers'?: string[], 'allowed_methods'?: string[], 'exposed_headers'?: string[]|false, 'max_age'?: int|bool|null }

### Table of Contents

#### Properties

$allowAllHeaders : bool
$allowAllMethods : bool
$allowAllOrigins : bool
$allowedHeaders : array<string|int, string>
$allowedMethods : array<string|int, string>
$allowedOrigins : array<string|int, string>
$allowedOriginsPatterns : array<string|int, string>
$exposedHeaders : array<string|int, string>
$maxAge : int|null
$supportsCredentials : bool

#### Methods

__construct() : mixed
addActualRequestHeaders() : Response
addPreflightRequestHeaders() : Response
handlePreflightRequest() : Response
isCorsRequest() : bool
isOriginAllowed() : bool
isPreflightRequest() : bool
setOptions() : void
varyHeader() : Response
configureAllowCredentials() : void
configureAllowedHeaders() : void
configureAllowedMethods() : void
configureAllowedOrigin() : void
configureExposedHeaders() : void
configureMaxAge() : void
convertWildcardToPattern() : string
  Create a pattern for a wildcard, based on Str::is() from Laravel
isSingleOriginAllowed() : bool
normalizeOptions() : void

### Properties

#### $allowAllHeaders

CorsService.php : 55
`private bool $allowAllHeaders = false`

#### $allowAllMethods

CorsService.php : 54
`private bool $allowAllMethods = false`

#### $allowAllOrigins

CorsService.php : 53
`private bool $allowAllOrigins = false`

#### $allowedHeaders

CorsService.php : 47
`private array<string|int, string> $allowedHeaders = []`

#### $allowedMethods

CorsService.php : 45
`private array<string|int, string> $allowedMethods = []`

#### $allowedOrigins

CorsService.php : 41
`private array<string|int, string> $allowedOrigins = []`

#### $allowedOriginsPatterns

CorsService.php : 43
`private array<string|int, string> $allowedOriginsPatterns = []`

#### $exposedHeaders

CorsService.php : 49
`private array<string|int, string> $exposedHeaders = []`

#### $maxAge

CorsService.php : 51
`private int|null $maxAge = 0`

#### $supportsCredentials

CorsService.php : 50
`private bool $supportsCredentials = false`

### Methods

#### __construct()

CorsService.php : 60
`public __construct([CorsInputOptions $options = [] ]) : mixed`

##### Parameters

$options : CorsInputOptions = []

#### addActualRequestHeaders()

CorsService.php : 191
`public addActualRequestHeaders(Response $response, Request $request) : Response`

##### Parameters

$response : Response
$request : Request

##### Return values

Response

#### addPreflightRequestHeaders()

CorsService.php : 153
`public addPreflightRequestHeaders(Response $response, Request $request) : Response`

##### Parameters

$response : Response
$request : Request

##### Return values

Response

#### handlePreflightRequest()

CorsService.php : 144
`public handlePreflightRequest(Request $request) : Response`

##### Parameters

$request : Request

##### Return values

Response

#### isCorsRequest()

CorsService.php : 134
`public isCorsRequest(Request $request) : bool`

##### Parameters

$request : Request

##### Return values

bool

#### isOriginAllowed()

CorsService.php : 170
`public isOriginAllowed(Request $request) : bool`

##### Parameters

$request : Request

##### Return values

bool

#### isPreflightRequest()

CorsService.php : 139
`public isPreflightRequest(Request $request) : bool`

##### Parameters

$request : Request

##### Return values

bool

#### setOptions()

CorsService.php : 70
`public setOptions(CorsInputOptions $options) : void`

##### Parameters

$options : CorsInputOptions

#### varyHeader()

CorsService.php : 275
`public varyHeader(Response $response, string $header) : Response`

##### Parameters

$response : Response
$header : string

##### Return values

Response

#### configureAllowCredentials()

CorsService.php : 254
`private configureAllowCredentials(Response $response, Request $request) : void`

##### Parameters

$response : Response
$request : Request

#### configureAllowedHeaders()

CorsService.php : 243
`private configureAllowedHeaders(Response $response, Request $request) : void`

##### Parameters

$response : Response
$request : Request

#### configureAllowedMethods()

CorsService.php : 231
`private configureAllowedMethods(Response $response, Request $request) : void`

##### Parameters

$response : Response
$request : Request

#### configureAllowedOrigin()

CorsService.php : 204
`private configureAllowedOrigin(Response $response, Request $request) : void`

##### Parameters

$response : Response
$request : Request

#### configureExposedHeaders()

CorsService.php : 261
`private configureExposedHeaders(Response $response, Request $request) : void`

##### Parameters

$response : Response
$request : Request

#### configureMaxAge()

CorsService.php : 268
`private configureMaxAge(Response $response, Request $request) : void`

##### Parameters

$response : Response
$request : Request

#### convertWildcardToPattern()

CorsService.php : 122

Create a pattern for a wildcard, based on Str::is() from Laravel

`private convertWildcardToPattern(string $pattern) : string`

##### Parameters

$pattern : string

##### Tags

see
  https://github.com/laravel/framework/blob/5.5/src/Illuminate/Support/Str.php

##### Return values

string

#### isSingleOriginAllowed()

CorsService.php : 222
`private isSingleOriginAllowed() : bool`

##### Return values

bool

#### normalizeOptions()

CorsService.php : 94
`private normalizeOptions() : void`

## Search results