Laravel_api_init/config/cors.php

15 lines
740 B
PHP
Raw Permalink Normal View History

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