Lae/config/cors.php

41 lines
1003 B
PHP
Raw Normal View History

2022-11-06 11:28:22 +00:00
<?php
2023-01-14 11:14:15 +00:00
$cors_origin = explode(',', env('CORS_ORIGINS'));
2023-01-14 10:54:30 +00:00
2023-01-14 21:37:25 +00:00
if (env('APP_ENV') === 'local') {
$cors_origin = ['*'];
}
2022-11-06 11:28:22 +00:00
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
2023-01-05 16:47:46 +00:00
'paths' => ['api', 'api/', 'api/*', 'sanctum/csrf-cookie', 'broadcasting/*'],
2022-11-06 11:28:22 +00:00
'allowed_methods' => ['*'],
2023-01-14 11:14:15 +00:00
'allowed_origins' => $cors_origin,
2022-11-06 11:28:22 +00:00
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
2022-11-07 00:58:12 +00:00
'max_age' => 86400,
2022-11-06 11:28:22 +00:00
2022-11-07 00:58:12 +00:00
'supports_credentials' => true,
2022-11-06 11:28:22 +00:00
];