@@ -61,55 +61,20 @@ php artisan vendor:publish --tag="cors"
61
61
62
62
> ** Note:** If you are explicitly whitelisting headers, you must include ` Origin ` or requests will fail to be recognized as CORS.
63
63
64
-
65
- ``` php
66
- <?php
67
-
68
- return [
69
-
70
- /*
71
- * You can enable CORS for 1 or multiple paths.
72
- * Example: ['api/*']
73
- */
74
- 'paths' => [],
75
-
76
- /*
77
- * Matches the request method. `[*]` allows all methods.
78
- */
79
- 'allowed_methods' => ['*'],
80
-
81
- /*
82
- * Matches the request origin. `[*]` allows all origins. Wildcards can be used, eg `*.mydomain.com`
83
- */
84
- 'allowed_origins' => ['*'],
85
-
86
- /*
87
- * Patterns that can be used with `preg_match` to match the origin.
88
- */
89
- 'allowed_origins_patterns' => [],
90
-
91
- /*
92
- * Sets the Access-Control-Allow-Headers response header. `[*]` allows all headers.
93
- */
94
- 'allowed_headers' => ['*'],
95
-
96
- /*
97
- * Sets the Access-Control-Expose-Headers response header.
98
- */
99
- 'exposed_headers' => false,
100
-
101
- /*
102
- * Sets the Access-Control-Max-Age response header.
103
- */
104
- 'max_age' => false,
105
-
106
- /*
107
- * Sets the Access-Control-Allow-Credentials header.
108
- */
109
- 'supports_credentials' => false,
110
- ];
111
64
112
- ```
65
+ ### Options
66
+
67
+ | Option | Description | Default value |
68
+ | --------------------------| --------------------------------------------------------------------------| ---------------|
69
+ | paths | You can enable CORS for 1 or multiple paths, eg. ` ['api/*'] ` | ` array() ` |
70
+ | allowed_origins | Matches the request origin. Wildcards can be used, eg ` *.mydomain.com ` | ` array('*') ` |
71
+ | allowed_origins_patterns | Matches the request origin with ` preg_match ` . | ` array() ` |
72
+ | allowed_methods | Matches the request method. | ` array('*') ` |
73
+ | allowed_headers | Sets the Access-Control-Allow-Headers response header. | ` array('*') ` |
74
+ | exposed_headers | Sets the Access-Control-Expose-Headers response header. | ` false ` |
75
+ | max_age | Sets the Access-Control-Max-Age response header. | ` 0 ` |
76
+ | supports_credentials | Sets the Access-Control-Allow-Credentials header. | ` false ` |
77
+
113
78
114
79
` allowed_origins ` , ` allowed_headers ` and ` allowed_methods ` can be set to ` ['*'] ` to accept any value.
115
80
0 commit comments