Laravel_api/config/cors.php

15 lines
725 B
PHP
Raw Permalink Normal View History

2019-03-01 14:08:34 +08:00
<?php
return [
2022-09-25 21:39:39 +08:00
'allow-credentials' => env('CORS_ALLOW_CREDENTIAILS', false), // set "Access-Control-Allow-Credentials" 👉 string "false" or "true".
2019-03-01 14:08:34 +08:00
'allow-headers' => ['*'], // ex: Content-Type, Accept, X-Requested-With
2022-09-25 21:39:39 +08:00
'expose-headers' => [],
2019-03-01 14:08:34 +08:00
'origins' => ['*'], // ex: http://localhost
'methods' => ['*'], // ex: GET, POST, PUT, PATCH, DELETE
'max-age' => env('CORS_ACCESS_CONTROL_MAX_AGE', 0),
'laravel' => [
2022-09-25 21:39:39 +08:00
'allow-route-prefix' => env('CORS_LARAVEL_ALLOW_ROUTE_PREFIX', '*'), // The prefix is using \Illumante\Http\Request::is method. 👉
2019-03-01 14:08:34 +08:00
'route-group-mode' => env('CORS_LARAVEL_ROUTE_GROUP_MODE', false),
],
];